Lines Matching defs:fst

35 #include <fst/cache.h>
36 #include <fst/expanded-fst.h>
37 #include <fst/fst.h>
38 #include <fst/matcher.h>
39 #include <fst/replace-util.h>
40 #include <fst/state-table.h>
41 #include <fst/test-properties.h>
43 namespace fst {
88 StateId fst_id; // current fst being walked
89 StateId fst_state; // current state in fst being walked, not to be
90 // confused with the state_id of the combined fst
340 // \param fst_tuples array of label/fst tuples, one for each non-terminal
373 const Fst<A> *fst = fst_tuples[i].second;
376 fst_array_.push_back(opts.take_ownership ? fst : fst->Copy());
377 if (fst->Start() == kNoStateId)
379 if(!fst->Properties(kILabelSorted, false))
381 if(!fst->Properties(kOLabelSorted, false))
383 inprops.push_back(fst->Properties(kCopyProperties, false));
385 if (!CompatSymbols(InputSymbols(), fst->InputSymbols())) {
387 << " does not match input symbols of base Fst (0'th fst)";
390 if (!CompatSymbols(OutputSymbols(), fst->OutputSymbols())) {
393 << "(0'th fst)";
467 // in an un-expandable replace fst.
473 // Return or compute start state of replace fst
480 const Fst<A>* fst = fst_array_[root_];
481 StateId fst_start = fst->Start();
501 const Fst<A>* fst = fst_array_[tuple.fst_id];
504 if (fst->Final(fst_state) != Weight::Zero() && stack.Depth() == 0)
505 SetFinal(s, fst->Final(fst_state));
523 const Fst<A>* fst = fst_array_[tuple.fst_id];
524 size_t num_arcs = fst->NumArcs(tuple.fst_state);
537 // so that recursing into an empty fst lead to a non co-accessible
560 const Fst<A>* fst = fst_array_[tuple.fst_id];
565 fst->NumInputEpsilons(tuple.fst_state);
569 ArcIterator<Fst<A> > aiter(*fst, tuple.fst_state);
597 const Fst<A>* fst = fst_array_[tuple.fst_id];
599 ArcIterator<Fst<A> > aiter(*fst, tuple.fst_state);
640 // If local fst is empty
665 // If local fst is empty
691 const Fst<A>* fst = fst_array_[tuple.fst_id];
698 if (fst->Final(fst_state) != Weight::Zero() && stack.Depth()) {
709 arcp->weight = fst->Final(fst_state);
717 // Compute the arc in the replace fst corresponding to a given
728 if (arc.olabel == 0) { // expand local fst
979 ReplaceFst(const ReplaceFst<A, T>& fst, bool safe = false)
980 : ImplToFst<Impl>(fst, safe) {}
1013 void operator=(const ReplaceFst<A> &fst); // disallow
1022 explicit StateIterator(const ReplaceFst<A, T> &fst)
1023 : CacheStateIterator< ReplaceFst<A, T> >(fst, fst.GetImpl()) {}
1056 ArcIterator(const ReplaceFst<A, T> &fst, StateId s)
1057 : fst_(fst), state_(s), pos_(0), offset_(0), flags_(0), arcs_(0),
1083 const Fst<A>* fst = fst_.GetImpl()->GetFst(tuple_.fst_id);
1084 fst->InitArcIterator(tuple_.fst_state, &local_data_);
1222 mutable ArcIteratorData<Arc> local_data_; // Arc iterator data in local fst
1241 ReplaceFstMatcher(const ReplaceFst<A, T> &fst, fst::MatchType match_type)
1242 : fst_(fst),
1244 s_(fst::kNoStateId),
1248 loop_(fst::kNoLabel, 0, A::Weight::One(), fst::kNoStateId) {
1249 if (match_type_ == fst::MATCH_OUTPUT)
1257 s_(fst::kNoStateId),
1260 loop_(fst::kNoLabel, 0, A::Weight::One(), fst::kNoStateId) {
1261 if (match_type_ == fst::MATCH_OUTPUT)
1451 } // namespace fst