Home | History | Annotate | Download | only in fst

Lines Matching defs:fst

19 // Functions and classes to invert an Fst.
24 #include <fst/arc-map.h>
25 #include <fst/mutable-fst.h>
28 namespace fst {
48 // Inverts the transduction corresponding to an FST by exchanging the
49 // FST's input and output labels. This version modifies its input.
56 void Invert(MutableFst<Arc> *fst) {
57 SymbolTable *input = fst->InputSymbols() ? fst->InputSymbols()->Copy() : 0;
58 SymbolTable *output = fst->OutputSymbols() ? fst->OutputSymbols()->Copy() : 0;
59 ArcMap(fst, InvertMapper<Arc>());
60 fst->SetInputSymbols(output);
61 fst->SetOutputSymbols(input);
67 // Inverts the transduction corresponding to an FST by exchanging the
68 // FST's input and output labels. This version is a delayed Fst.
84 explicit InvertFst(const Fst<A> &fst) : ArcMapFst<A, A, C>(fst, C()) {
85 GetImpl()->SetOutputSymbols(fst.InputSymbols());
86 GetImpl()->SetInputSymbols(fst.OutputSymbols());
89 // See Fst<>::Copy() for doc.
90 InvertFst(const InvertFst<A> &fst, bool safe = false)
91 : ArcMapFst<A, A, C>(fst, safe) {}
93 // Get a copy of this InvertFst. See Fst<>::Copy() for further doc.
105 explicit StateIterator(const InvertFst<A> &fst)
106 : StateIterator< ArcMapFst<A, A, InvertMapper<A> > >(fst) {}
115 ArcIterator(const InvertFst<A> &fst, typename A::StateId s)
116 : ArcIterator< ArcMapFst<A, A, InvertMapper<A> > >(fst, s) {}
123 } // namespace fst