Home | History | Annotate | Download | only in fst

Lines Matching defs:fst

19 // Functions and classes to compute the concatenative closure of an Fst.
28 #include <fst/mutable-fst.h>
29 #include <fst/rational.h>
32 namespace fst {
35 // MutableFst input. If FST transduces string x to y with weight a,
46 void Closure(MutableFst<Arc> *fst, ClosureType closure_type) {
51 uint64 props = fst->Properties(kFstProperties, false);
52 StateId start = fst->Start();
53 for (StateIterator< MutableFst<Arc> > siter(*fst);
57 Weight final = fst->Final(s);
59 fst->AddArc(s, Arc(0, 0, final, start));
62 fst->ReserveStates(fst->NumStates() + 1);
63 StateId nstart = fst->AddState();
64 fst->SetStart(nstart);
65 fst->SetFinal(nstart, Weight::One());
67 fst->AddArc(nstart, Arc(0, 0, Weight::One(), start));
69 fst->SetProperties(ClosureProperties(props, closure_type == CLOSURE_STAR),
76 void Closure(RationalFst<Arc> *fst, ClosureType closure_type) {
77 fst->GetImpl()->AddClosure(closure_type);
92 // Fst. If FST transduces string x to y with weight a, then the
110 ClosureFst(const Fst<A> &fst, ClosureType closure_type) {
111 GetImpl()->InitClosure(fst, closure_type);
114 ClosureFst(const Fst<A> &fst, const ClosureFstOptions &opts)
116 GetImpl()->InitClosure(fst, opts.type);
119 // See Fst<>::Copy() for doc.
120 ClosureFst(const ClosureFst<A> &fst, bool safe = false)
121 : RationalFst<A>(fst, safe) {}
123 // Get a copy of this ClosureFst. See Fst<>::Copy() for further doc.
134 explicit StateIterator(const ClosureFst<A> &fst)
135 : StateIterator< RationalFst<A> >(fst) {}
145 ArcIterator(const ClosureFst<A> &fst, StateId s)
146 : ArcIterator< RationalFst<A> >(fst, s) {}
153 } // namespace fst