20 #ifndef FST_INTERSECT_H_ 21 #define FST_INTERSECT_H_ 45 template <
class Arc,
class M = Matcher<Fst<Arc>>,
46 class Filter = SequenceComposeFilter<M>,
48 GenericComposeStateTable<Arc,
typename Filter::FilterState>>
79 using Base::CreateBase;
80 using Base::CreateBase1;
81 using Base::Properties;
85 :
Base(CreateBase(fst1, fst2, opts)) {
86 const bool acceptors =
89 FSTERROR() <<
"IntersectFst: Input FSTs are not acceptors";
90 GetMutableImpl()->SetProperties(
kError);
94 template <
class M,
class Filter,
class StateTable>
97 :
Base(CreateBase1(fst1, fst2, opts)) {
98 const bool acceptors =
101 FSTERROR() <<
"IntersectFst: input FSTs are not acceptors";
102 GetMutableImpl()->SetProperties(
kError);
116 using Base::GetMutableImpl;
156 switch (opts.filter_type) {
200 if (opts.connect)
Connect(ofst);
205 #endif // FST_INTERSECT_H_
ArcIterator(const IntersectFst< Arc > &fst, StateId s)
typename ComposeFst< Arc >::Arc Arc
CacheOptions(bool gc=FST_FLAGS_fst_default_cache_gc, size_t gc_limit=FST_FLAGS_fst_default_cache_gc_limit)
virtual uint64_t Properties(uint64_t mask, bool test) const =0
IntersectFstOptions()=default
IntersectFst(const Fst< Arc > &fst1, const Fst< Arc > &fst2, const IntersectFstOptions< Arc, M, Filter, StateTable > &opts)
IntersectFst(const Fst< Arc > &fst1, const Fst< Arc > &fst2, const CacheOptions &opts=CacheOptions())
StateIterator(const IntersectFst< Arc > &fst)
constexpr uint64_t kError
IntersectFst * Copy(bool safe=false) const override
void Intersect(const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const IntersectOptions &opts=IntersectOptions())
void Connect(MutableFst< Arc > *fst)
typename ComposeFst< Arc >::Arc Arc
typename Arc::Weight Weight
typename Arc::StateId StateId
IntersectFst(const IntersectFst &fst, bool safe=false)
typename Arc::StateId StateId
ComposeOptions IntersectOptions
IntersectFstOptions(const CacheOptions &opts, M *matcher1=nullptr, M *matcher2=nullptr, Filter *filter=nullptr, StateTable *state_table=nullptr)
constexpr uint64_t kAcceptor