FST  openfst-1.8.2.post1
OpenFst Library
compose.h
Go to the documentation of this file.
1 // Copyright 2005-2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the 'License');
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an 'AS IS' BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // See www.openfst.org for extensive documentation on this weighted
16 // finite-state transducer library.
17 //
18 // Composes a PDT and an FST.
19 
20 #ifndef FST_EXTENSIONS_PDT_COMPOSE_H_
21 #define FST_EXTENSIONS_PDT_COMPOSE_H_
22 
23 #include <cstdint>
24 #include <list>
25 
26 #include <fst/extensions/pdt/pdt.h>
27 #include <fst/compose.h>
28 
29 namespace fst {
30 
31 // Returns paren arcs for Find(kNoLabel).
32 inline constexpr uint32_t kParenList = 0x00000001;
33 
34 // Returns a kNolabel loop for Find(paren).
35 inline constexpr uint32_t kParenLoop = 0x00000002;
36 
37 // This class is a matcher that treats parens as multi-epsilon labels.
38 // It is most efficient if the parens are in a range non-overlapping with
39 // the non-paren labels.
40 template <class F>
41 class ParenMatcher {
42  public:
43  using FST = F;
45  using Arc = typename FST::Arc;
46  using Label = typename Arc::Label;
47  using StateId = typename Arc::StateId;
48  using Weight = typename Arc::Weight;
49 
50  // This makes a copy of the FST.
51  ParenMatcher(const FST &fst, MatchType match_type,
52  uint32_t flags = (kParenLoop | kParenList))
53  : matcher_(fst, match_type), match_type_(match_type), flags_(flags) {
54  if (match_type == MATCH_INPUT) {
55  loop_.ilabel = kNoLabel;
56  loop_.olabel = 0;
57  } else {
58  loop_.ilabel = 0;
59  loop_.olabel = kNoLabel;
60  }
61  loop_.weight = Weight::One();
62  loop_.nextstate = kNoStateId;
63  }
64 
65  // This doesn't copy the FST.
66  ParenMatcher(const FST *fst, MatchType match_type,
67  uint32_t flags = (kParenLoop | kParenList))
68  : matcher_(fst, match_type), match_type_(match_type), flags_(flags) {
69  if (match_type == MATCH_INPUT) {
70  loop_.ilabel = kNoLabel;
71  loop_.olabel = 0;
72  } else {
73  loop_.ilabel = 0;
74  loop_.olabel = kNoLabel;
75  }
76  loop_.weight = Weight::One();
77  loop_.nextstate = kNoStateId;
78  }
79 
80  // This makes a copy of the FST.
81  ParenMatcher(const ParenMatcher<FST> &matcher, bool safe = false)
82  : matcher_(matcher.matcher_, safe),
83  match_type_(matcher.match_type_),
84  flags_(matcher.flags_),
85  open_parens_(matcher.open_parens_),
86  close_parens_(matcher.close_parens_),
87  loop_(matcher.loop_) {
88  loop_.nextstate = kNoStateId;
89  }
90 
91  ParenMatcher<FST> *Copy(bool safe = false) const {
92  return new ParenMatcher<FST>(*this, safe);
93  }
94 
95  MatchType Type(bool test) const { return matcher_.Type(test); }
96 
97  void SetState(StateId s) {
98  matcher_.SetState(s);
99  loop_.nextstate = s;
100  }
101 
102  bool Find(Label match_label);
103 
104  bool Done() const { return done_; }
105 
106  const Arc &Value() const { return paren_loop_ ? loop_ : matcher_.Value(); }
107 
108  void Next();
109 
110  Weight Final(StateId s) { return matcher_.Final(s); }
111 
112  ssize_t Priority(StateId s) { return matcher_.Priority(s); }
113 
114  const FST &GetFst() const { return matcher_.GetFst(); }
115 
116  uint64_t Properties(uint64_t props) const {
117  return matcher_.Properties(props);
118  }
119 
120  uint32_t Flags() const { return matcher_.Flags(); }
121 
122  void AddOpenParen(Label label) {
123  if (label == 0) {
124  FSTERROR() << "ParenMatcher: Bad open paren label: 0";
125  } else {
126  open_parens_.Insert(label);
127  }
128  }
129 
130  void AddCloseParen(Label label) {
131  if (label == 0) {
132  FSTERROR() << "ParenMatcher: Bad close paren label: 0";
133  } else {
134  close_parens_.Insert(label);
135  }
136  }
137 
138  void RemoveOpenParen(Label label) {
139  if (label == 0) {
140  FSTERROR() << "ParenMatcher: Bad open paren label: 0";
141  } else {
142  open_parens_.Erase(label);
143  }
144  }
145 
146  void RemoveCloseParen(Label label) {
147  if (label == 0) {
148  FSTERROR() << "ParenMatcher: Bad close paren label: 0";
149  } else {
150  close_parens_.Erase(label);
151  }
152  }
153 
154  void ClearOpenParens() { open_parens_.Clear(); }
155 
156  void ClearCloseParens() { close_parens_.Clear(); }
157 
158  bool IsOpenParen(Label label) const { return open_parens_.Member(label); }
159 
160  bool IsCloseParen(Label label) const { return close_parens_.Member(label); }
161 
162  private:
163  // Advances matcher to next open paren, returning true if it exists.
164  bool NextOpenParen();
165 
166  // Advances matcher to next close paren, returning true if it exists.
167  bool NextCloseParen();
168 
169  M matcher_;
170  MatchType match_type_; // Type of match to perform.
171  uint32_t flags_;
172  // Open paren label set.
173  CompactSet<Label, kNoLabel> open_parens_;
174  // Close paren label set.
175  CompactSet<Label, kNoLabel> close_parens_;
176  bool open_paren_list_; // Matching open paren list?
177  bool close_paren_list_; // Matching close paren list?
178  bool paren_loop_; // Current arc is the implicit paren loop?
179  mutable Arc loop_; // For non-consuming symbols.
180  bool done_; // Matching done?
181 
182  ParenMatcher &operator=(const ParenMatcher &) = delete;
183 };
184 
185 template <class FST>
186 inline bool ParenMatcher<FST>::Find(Label match_label) {
187  open_paren_list_ = false;
188  close_paren_list_ = false;
189  paren_loop_ = false;
190  done_ = false;
191  // Returns all parenthesis arcs.
192  if (match_label == kNoLabel && (flags_ & kParenList)) {
193  if (open_parens_.LowerBound() != kNoLabel) {
194  matcher_.LowerBound(open_parens_.LowerBound());
195  open_paren_list_ = NextOpenParen();
196  if (open_paren_list_) return true;
197  }
198  if (close_parens_.LowerBound() != kNoLabel) {
199  matcher_.LowerBound(close_parens_.LowerBound());
200  close_paren_list_ = NextCloseParen();
201  if (close_paren_list_) return true;
202  }
203  }
204  // Returns the implicit paren loop.
205  if (match_label > 0 && (flags_ & kParenLoop) &&
206  (IsOpenParen(match_label) || IsCloseParen(match_label))) {
207  paren_loop_ = true;
208  return true;
209  }
210  // Returns all other labels.
211  if (matcher_.Find(match_label)) return true;
212  done_ = true;
213  return false;
214 }
215 
216 template <class FST>
217 inline void ParenMatcher<FST>::Next() {
218  if (paren_loop_) {
219  paren_loop_ = false;
220  done_ = true;
221  } else if (open_paren_list_) {
222  matcher_.Next();
223  open_paren_list_ = NextOpenParen();
224  if (open_paren_list_) return;
225  if (close_parens_.LowerBound() != kNoLabel) {
226  matcher_.LowerBound(close_parens_.LowerBound());
227  close_paren_list_ = NextCloseParen();
228  if (close_paren_list_) return;
229  }
230  done_ = !matcher_.Find(kNoLabel);
231  } else if (close_paren_list_) {
232  matcher_.Next();
233  close_paren_list_ = NextCloseParen();
234  if (close_paren_list_) return;
235  done_ = !matcher_.Find(kNoLabel);
236  } else {
237  matcher_.Next();
238  done_ = matcher_.Done();
239  }
240 }
241 
242 // Advances matcher to next open paren, returning true if it exists.
243 template <class FST>
244 inline bool ParenMatcher<FST>::NextOpenParen() {
245  for (; !matcher_.Done(); matcher_.Next()) {
246  Label label = match_type_ == MATCH_INPUT ? matcher_.Value().ilabel
247  : matcher_.Value().olabel;
248  if (label > open_parens_.UpperBound()) return false;
249  if (IsOpenParen(label)) return true;
250  }
251  return false;
252 }
253 
254 // Advances matcher to next close paren, returning true if it exists.
255 template <class FST>
256 inline bool ParenMatcher<FST>::NextCloseParen() {
257  for (; !matcher_.Done(); matcher_.Next()) {
258  Label label = match_type_ == MATCH_INPUT ? matcher_.Value().ilabel
259  : matcher_.Value().olabel;
260  if (label > close_parens_.UpperBound()) return false;
261  if (IsCloseParen(label)) return true;
262  }
263  return false;
264 }
265 
266 template <class Filter>
267 class ParenFilter {
268  public:
269  using FST1 = typename Filter::FST1;
270  using FST2 = typename Filter::FST2;
271  using Arc = typename Filter::Arc;
272  using Label = typename Arc::Label;
273  using StateId = typename Arc::StateId;
274  using Weight = typename Arc::Weight;
275 
276  using Matcher1 = typename Filter::Matcher1;
277  using Matcher2 = typename Filter::Matcher2;
278 
279  using StackId = StateId;
281  using FilterState1 = typename Filter::FilterState;
284 
285  ParenFilter(const FST1 &fst1, const FST2 &fst2, Matcher1 *matcher1 = nullptr,
286  Matcher2 *matcher2 = nullptr,
287  const std::vector<std::pair<Label, Label>> *parens = nullptr,
288  bool expand = false, bool keep_parens = true)
289  : filter_(fst1, fst2, matcher1, matcher2),
290  parens_(parens ? *parens : std::vector<std::pair<Label, Label>>()),
291  expand_(expand),
292  keep_parens_(keep_parens),
293  fs_(FilterState::NoState()),
294  stack_(parens_),
295  paren_id_(-1) {
296  if (parens) {
297  for (const auto &pair : *parens) {
298  parens_.push_back(pair);
299  GetMatcher1()->AddOpenParen(pair.first);
300  GetMatcher2()->AddOpenParen(pair.first);
301  if (!expand_) {
302  GetMatcher1()->AddCloseParen(pair.second);
303  GetMatcher2()->AddCloseParen(pair.second);
304  }
305  }
306  }
307  }
308 
309  ParenFilter(const ParenFilter &filter, bool safe = false)
310  : filter_(filter.filter_, safe),
311  parens_(filter.parens_),
312  expand_(filter.expand_),
313  keep_parens_(filter.keep_parens_),
314  fs_(FilterState::NoState()),
315  stack_(filter.parens_),
316  paren_id_(-1) {}
317 
318  FilterState Start() const {
319  return FilterState(filter_.Start(), FilterState2(0));
320  }
321 
322  void SetState(StateId s1, StateId s2, const FilterState &fs) {
323  fs_ = fs;
324  filter_.SetState(s1, s2, fs_.GetState1());
325  if (!expand_) return;
326  ssize_t paren_id = stack_.Top(fs.GetState2().GetState());
327  if (paren_id != paren_id_) {
328  if (paren_id_ != -1) {
329  GetMatcher1()->RemoveCloseParen(parens_[paren_id_].second);
330  GetMatcher2()->RemoveCloseParen(parens_[paren_id_].second);
331  }
332  paren_id_ = paren_id;
333  if (paren_id_ != -1) {
334  GetMatcher1()->AddCloseParen(parens_[paren_id_].second);
335  GetMatcher2()->AddCloseParen(parens_[paren_id_].second);
336  }
337  }
338  }
339 
340  FilterState FilterArc(Arc *arc1, Arc *arc2) const {
341  const auto fs1 = filter_.FilterArc(arc1, arc2);
342  const auto &fs2 = fs_.GetState2();
343  if (fs1 == FilterState1::NoState()) return FilterState::NoState();
344  if (arc1->olabel == kNoLabel && arc2->ilabel) { // arc2 parentheses.
345  if (keep_parens_) {
346  arc1->ilabel = arc2->ilabel;
347  } else if (arc2->ilabel) {
348  arc2->olabel = arc1->ilabel;
349  }
350  return FilterParen(arc2->ilabel, fs1, fs2);
351  } else if (arc2->ilabel == kNoLabel && arc1->olabel) { // arc1 parentheses.
352  if (keep_parens_) {
353  arc2->olabel = arc1->olabel;
354  } else {
355  arc1->ilabel = arc2->olabel;
356  }
357  return FilterParen(arc1->olabel, fs1, fs2);
358  } else {
359  return FilterState(fs1, fs2);
360  }
361  }
362 
363  void FilterFinal(Weight *w1, Weight *w2) const {
364  if (fs_.GetState2().GetState() != 0) *w1 = Weight::Zero();
365  filter_.FilterFinal(w1, w2);
366  }
367 
368  // Returns respective matchers; ownership stays with filter.
369 
370  Matcher1 *GetMatcher1() { return filter_.GetMatcher1(); }
371 
372  Matcher2 *GetMatcher2() { return filter_.GetMatcher2(); }
373 
374  uint64_t Properties(uint64_t iprops) const {
375  return filter_.Properties(iprops) & kILabelInvariantProperties &
377  }
378 
379  private:
380  const FilterState FilterParen(Label label, const FilterState1 &fs1,
381  const FilterState2 &fs2) const {
382  if (!expand_) return FilterState(fs1, fs2);
383  const auto stack_id = stack_.Find(fs2.GetState(), label);
384  if (stack_id < 0) {
385  return FilterState::NoState();
386  } else {
387  return FilterState(fs1, FilterState2(stack_id));
388  }
389  }
390 
391  Filter filter_;
392  std::vector<std::pair<Label, Label>> parens_;
393  bool expand_; // Expands to FST?
394  bool keep_parens_; // Retains parentheses in output?
395  FilterState fs_; // Current filter state.
396  mutable ParenStack stack_;
397  ssize_t paren_id_;
398 };
399 
400 // Class to setup composition options for PDT composition. Default is to take
401 // the PDT as the first composition argument.
402 template <class Arc, bool left_pdt = true>
404  : public ComposeFstOptions<
405  Arc, ParenMatcher<Fst<Arc>>,
406  ParenFilter<AltSequenceComposeFilter<ParenMatcher<Fst<Arc>>>>> {
407  public:
408  using Label = typename Arc::Label;
411 
415 
417  const std::vector<std::pair<Label, Label>> &parens,
418  const Fst<Arc> &ifst2, bool expand = false,
419  bool keep_parens = true) {
420  matcher1 = new PdtMatcher(ifst1, MATCH_OUTPUT, kParenList);
421  matcher2 = new PdtMatcher(ifst2, MATCH_INPUT, kParenLoop);
422  filter = new PdtFilter(ifst1, ifst2, matcher1, matcher2, &parens, expand,
423  keep_parens);
424  }
425 };
426 
427 // Class to setup composition options for PDT with FST composition.
428 // Specialization is for the FST as the first composition argument.
429 template <class Arc>
431  : public ComposeFstOptions<
432  Arc, ParenMatcher<Fst<Arc>>,
433  ParenFilter<SequenceComposeFilter<ParenMatcher<Fst<Arc>>>>> {
434  public:
435  using Label = typename Arc::Label;
438 
442 
443  PdtComposeFstOptions(const Fst<Arc> &ifst1, const Fst<Arc> &ifst2,
444  const std::vector<std::pair<Label, Label>> &parens,
445  bool expand = false, bool keep_parens = true) {
446  matcher1 = new PdtMatcher(ifst1, MATCH_OUTPUT, kParenLoop);
447  matcher2 = new PdtMatcher(ifst2, MATCH_INPUT, kParenList);
448  filter = new PdtFilter(ifst1, ifst2, matcher1, matcher2, &parens, expand,
449  keep_parens);
450  }
451 };
452 
453 enum class PdtComposeFilter : uint8_t {
454  PAREN, // Bar-Hillel construction; keeps parentheses.
455  EXPAND, // Bar-Hillel + expansion; removes parentheses.
456  EXPAND_PAREN, // Bar-Hillel + expansion; keeps parentheses.
457 };
458 
460  bool connect; // Connect output?
461  PdtComposeFilter filter_type; // Pre-defined filter to use.
462 
463  explicit PdtComposeOptions(bool connect = true, PdtComposeFilter filter_type =
465  : connect(connect), filter_type(filter_type) {}
466 };
467 
468 // Composes pushdown transducer (PDT) encoded as an FST (1st arg) and an FST
469 // (2nd arg) with the result also a PDT encoded as an FST (3rd arg). In the
470 // PDTs, some transitions are labeled with open or close parentheses. To be
471 // interpreted as a PDT, the parens must balance on a path (see PdtExpand()).
472 // The open-close parenthesis label pairs are passed using the parens argument.
473 template <class Arc>
474 void Compose(
475  const Fst<Arc> &ifst1,
476  const std::vector<std::pair<typename Arc::Label, typename Arc::Label>>
477  &parens,
478  const Fst<Arc> &ifst2, MutableFst<Arc> *ofst,
479  const PdtComposeOptions &opts = PdtComposeOptions()) {
480  bool expand = opts.filter_type != PdtComposeFilter::PAREN;
481  bool keep_parens = opts.filter_type != PdtComposeFilter::EXPAND;
482  PdtComposeFstOptions<Arc, true> copts(ifst1, parens, ifst2, expand,
483  keep_parens);
484  copts.gc_limit = 0;
485  *ofst = ComposeFst<Arc>(ifst1, ifst2, copts);
486  if (opts.connect) Connect(ofst);
487 }
488 
489 // Composes an FST (1st arg) and pushdown transducer (PDT) encoded as an FST
490 // (2nd arg) with the result also a PDT encoded as an FST (3rd arg). In the
491 // PDTs, some transitions are labeled with open or close parentheses. To be
492 // interpreted as a PDT, the parens must balance on a path (see ExpandFst()).
493 // The open-close parenthesis label pairs are passed using the parens argument.
494 template <class Arc>
495 void Compose(
496  const Fst<Arc> &ifst1, const Fst<Arc> &ifst2,
497  const std::vector<std::pair<typename Arc::Label, typename Arc::Label>>
498  &parens,
499  MutableFst<Arc> *ofst,
500  const PdtComposeOptions &opts = PdtComposeOptions()) {
501  bool expand = opts.filter_type != PdtComposeFilter::PAREN;
502  bool keep_parens = opts.filter_type != PdtComposeFilter::EXPAND;
503  PdtComposeFstOptions<Arc, false> copts(ifst1, ifst2, parens, expand,
504  keep_parens);
505  copts.gc_limit = 0;
506  *ofst = ComposeFst<Arc>(ifst1, ifst2, copts);
507  if (opts.connect) Connect(ofst);
508 }
509 
510 } // namespace fst
511 
512 #endif // FST_EXTENSIONS_PDT_COMPOSE_H_
void SetState(StateId s1, StateId s2, const FilterState &fs)
Definition: compose.h:322
void Next() final
Definition: matcher.h:310
void RemoveOpenParen(Label label)
Definition: compose.h:138
constexpr uint32_t kParenLoop
Definition: compose.h:35
void SetState(StateId s) final
Definition: matcher.h:250
FilterState Start() const
Definition: compose.h:318
PdtComposeFstOptions(const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, const std::vector< std::pair< Label, Label >> &parens, bool expand=false, bool keep_parens=true)
Definition: compose.h:443
bool IsOpenParen(Label label) const
Definition: compose.h:158
constexpr int kNoLabel
Definition: fst.h:201
typename FST::Arc Arc
Definition: compose.h:45
Matcher1 * GetMatcher1()
Definition: compose.h:370
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::Arc Arc
Definition: compose.h:271
ParenMatcher(const FST &fst, MatchType match_type, uint32_t flags=(kParenLoop|kParenList))
Definition: compose.h:51
uint32_t Flags() const
Definition: compose.h:120
void LowerBound(Label label)
Definition: matcher.h:281
void RemoveCloseParen(Label label)
Definition: compose.h:146
ParenMatcher(const FST *fst, MatchType match_type, uint32_t flags=(kParenLoop|kParenList))
Definition: compose.h:66
const Arc & Value() const final
Definition: matcher.h:304
MatchType
Definition: fst.h:193
Key LowerBound() const
Definition: util.h:482
const Arc & Value() const
Definition: compose.h:106
PdtComposeOptions(bool connect=true, PdtComposeFilter filter_type=PdtComposeFilter::PAREN)
Definition: compose.h:463
bool Done() const
Definition: compose.h:104
void Connect(MutableFst< Arc > *fst)
Definition: connect.h:278
void Erase(Key key)
Definition: util.h:443
Key UpperBound() const
Definition: util.h:485
constexpr uint32_t kParenList
Definition: compose.h:32
MatchType Type(bool test) const override
Definition: matcher.h:234
FilterState FilterArc(Arc *arc1, Arc *arc2) const
Definition: compose.h:340
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::FST1 FST1
Definition: compose.h:269
constexpr int kNoStateId
Definition: fst.h:202
PdtComposeFstOptions(const Fst< Arc > &ifst1, const std::vector< std::pair< Label, Label >> &parens, const Fst< Arc > &ifst2, bool expand=false, bool keep_parens=true)
Definition: compose.h:416
typename Arc::StateId StateId
Definition: compose.h:47
#define FSTERROR()
Definition: util.h:53
bool Done() const final
Definition: matcher.h:294
virtual uint32_t Flags() const
Definition: matcher.h:156
bool Find(Label match_label) final
Definition: matcher.h:263
MatchType Type(bool test) const
Definition: compose.h:95
void SetState(StateId s)
Definition: compose.h:97
void ClearOpenParens()
Definition: compose.h:154
void Compose(const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const ComposeOptions &opts=ComposeOptions())
Definition: compose.h:995
uint64_t Properties(uint64_t props) const
Definition: compose.h:116
Weight Final(StateId s) const final
Definition: matcher.h:318
ParenMatcher< FST > * Copy(bool safe=false) const
Definition: compose.h:91
bool IsCloseParen(Label label) const
Definition: compose.h:160
void Insert(Key key)
Definition: util.h:437
ParenFilter(const ParenFilter &filter, bool safe=false)
Definition: compose.h:309
void Clear()
Definition: util.h:454
uint64_t Properties(uint64_t iprops) const
Definition: compose.h:374
void ClearCloseParens()
Definition: compose.h:156
void FilterFinal(Weight *w1, Weight *w2) const
Definition: compose.h:363
void AddCloseParen(Label label)
Definition: compose.h:130
const FST & GetFst() const
Definition: compose.h:114
constexpr uint64_t kOLabelInvariantProperties
Definition: properties.h:269
PdtComposeFilter filter_type
Definition: compose.h:461
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::FST2 FST2
Definition: compose.h:270
ssize_t Priority(StateId s)
Definition: compose.h:112
constexpr uint64_t kILabelInvariantProperties
Definition: properties.h:260
Weight Final(StateId s)
Definition: compose.h:110
ssize_t Priority(StateId s) final
Definition: matcher.h:320
Matcher2 * GetMatcher2()
Definition: compose.h:372
typename Arc::Weight Weight
Definition: compose.h:48
bool Member(Key key) const
Definition: util.h:467
ParenFilter(const FST1 &fst1, const FST2 &fst2, Matcher1 *matcher1=nullptr, Matcher2 *matcher2=nullptr, const std::vector< std::pair< Label, Label >> *parens=nullptr, bool expand=false, bool keep_parens=true)
Definition: compose.h:285
const FST & GetFst() const override
Definition: matcher.h:322
const FilterState2 & GetState2() const
Definition: filter-state.h:177
bool Find(Label match_label)
Definition: compose.h:186
ParenMatcher(const ParenMatcher< FST > &matcher, bool safe=false)
Definition: compose.h:81
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::FilterState FilterState1
Definition: compose.h:281
typename Arc::Label Label
Definition: compose.h:408
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::Matcher1 Matcher1
Definition: compose.h:276
typename Arc::Label Label
Definition: compose.h:46
size_t gc_limit
Definition: cache.h:45
PdtComposeFilter
Definition: compose.h:453
uint64_t Properties(uint64_t inprops) const override
Definition: matcher.h:324
typename AltSequenceComposeFilter< ParenMatcher< Fst< Arc > > >::Matcher2 Matcher2
Definition: compose.h:277
void AddOpenParen(Label label)
Definition: compose.h:122