Lines Matching defs:fst
22 #include "fst/lib/mutable-fst.h"
23 #include "fst/lib/rational.h"
25 namespace fst {
39 void Closure(MutableFst<Arc> *fst, ClosureType closure_type) {
44 uint64 props = fst->Properties(kFstProperties, false);
45 StateId start = fst->Start();
46 for (StateIterator< MutableFst<Arc> > siter(*fst);
50 Weight final = fst->Final(s);
52 fst->AddArc(s, Arc(0, 0, final, start));
55 StateId nstart = fst->AddState();
56 fst->SetStart(nstart);
57 fst->SetFinal(nstart, Weight::One());
59 fst->AddArc(nstart, Arc(0, 0, Weight::One(), start));
61 fst->SetProperties(ClosureProperties(props, closure_type == CLOSURE_STAR),
68 void Closure(RationalFst<Arc> *fst, ClosureType closure_type) {
69 fst->Impl()->AddClosure(closure_type);
102 ClosureFst(const Fst<A> &fst, ClosureType closure_type) {
103 Impl()->InitClosure(fst, closure_type);
106 ClosureFst(const Fst<A> &fst, const ClosureFstOptions &opts)
108 Impl()->InitClosure(fst, opts.type);
111 ClosureFst(const ClosureFst<A> &fst) : RationalFst<A>(fst) {}
121 explicit StateIterator(const ClosureFst<A> &fst)
122 : StateIterator< RationalFst<A> >(fst) {}
132 ArcIterator(const ClosureFst<A> &fst, StateId s)
133 : ArcIterator< RationalFst<A> >(fst, s) {}
140 } // namespace fst