Recursivively replaces arcs in the root Fst with other Fsts. This version is a delayed Fst. More...
#include <fst/replace.h>
Inherits ImplToFst< ReplaceFstImpl< A, T > >.

Public Types | |
| typedef A | Arc |
| typedef A::Label | Label |
| typedef A::Weight | Weight |
| typedef A::StateId | StateId |
| typedef CacheState< A > | State |
| typedef ReplaceFstImpl< A, T > | Impl |
Public Member Functions | |
| ReplaceFst (const vector< pair< Label, const Fst< A > * > > &fst_array, Label root) | |
| ReplaceFst (const vector< pair< Label, const Fst< A > * > > &fst_array, const ReplaceFstOptions< A, T > &opts) | |
| ReplaceFst (const ReplaceFst< A, T > &fst, bool safe=false) | |
| See Fst<>::Copy() for doc. | |
| virtual ReplaceFst< A, T > * | Copy (bool safe=false) const |
| Get a copy of this ReplaceFst. See Fst<>::Copy() for further doc. | |
| virtual void | InitStateIterator (StateIteratorData< A > *data) const |
| virtual void | InitArcIterator (StateId s, ArcIteratorData< A > *data) const |
| virtual MatcherBase< A > * | InitMatcher (MatchType match_type) const |
| bool | CyclicDependencies () const |
Friends | |
| class | ArcIterator< ReplaceFst< A, T > > |
| class | StateIterator< ReplaceFst< A, T > > |
Recursivively replaces arcs in the root Fst with other Fsts. This version is a delayed Fst.
ReplaceFst supports dynamic replacement of arcs in one Fst with another Fst. This replacement is recursive. ReplaceFst can be used to support a variety of delayed constructions such as recursive transition networks, union, or closure. It is constructed with an array of Fst(s). One Fst represents the root (or topology) machine. The root Fst refers to other Fsts by recursively replacing arcs labeled as non-terminals with the matching non-terminal Fst. Currently the ReplaceFst uses the output symbols of the arcs to determine whether the arc is a non-terminal arc or not. A non-terminal can be any label that is not a non-zero terminal label in the output alphabet.
Note that the constructor uses a vector of pair<>. These correspond to the tuple of non-terminal Label and corresponding Fst. For example to implement the closure operation we need 2 Fsts. The first root Fst is a single Arc on the start State that self loops, it references the particular machine for which we are performing the closure operation.
The ReplaceFst class supports an optionally caching arc iterator: ArcIterator< ReplaceFst > The ReplaceFst need to be built such that it is known to be ilabel or olabel sorted (see usage below).
Observe that Matcher<Fst > will use the optionally caching arc iterator when available (Fst is ilabel sorted and matching on the input, or Fst is olabel sorted and matching on the output). In order to obtain the most efficient behaviour, it is recommended to set 'epsilon_on_replace' to false (this means constructing acceptors as transducers with epsilons on the input side of nonterminal arcs) and matching on the input side.
This class attaches interface to implementation and handles reference counting, delegating most methods to ImplToFst.
Definition at line 932 of file replace.h.
| typedef A fst::ReplaceFst< A, T >::Arc |
Reimplemented from fst::ImplToFst< ReplaceFstImpl< A, T > >.
| typedef ReplaceFstImpl<A, T> fst::ReplaceFst< A, T >::Impl |
| typedef A::Label fst::ReplaceFst< A, T >::Label |
| typedef CacheState<A> fst::ReplaceFst< A, T >::State |
| typedef A::StateId fst::ReplaceFst< A, T >::StateId |
Reimplemented from fst::ImplToFst< ReplaceFstImpl< A, T > >.
| typedef A::Weight fst::ReplaceFst< A, T >::Weight |
Reimplemented from fst::ImplToFst< ReplaceFstImpl< A, T > >.
| fst::ReplaceFst< A, T >::ReplaceFst | ( | const vector< pair< Label, const Fst< A > * > > & | fst_array, | |
| Label | root | |||
| ) | [inline] |
| fst::ReplaceFst< A, T >::ReplaceFst | ( | const vector< pair< Label, const Fst< A > * > > & | fst_array, | |
| const ReplaceFstOptions< A, T > & | opts | |||
| ) | [inline] |
| fst::ReplaceFst< A, T >::ReplaceFst | ( | const ReplaceFst< A, T > & | fst, | |
| bool | safe = false | |||
| ) | [inline] |
See Fst<>::Copy() for doc.
| virtual ReplaceFst<A, T>* fst::ReplaceFst< A, T >::Copy | ( | bool | safe = false |
) | const [inline, virtual] |
Get a copy of this ReplaceFst. See Fst<>::Copy() for further doc.
Implements fst::Fst< typename ReplaceFstImpl< A, T >::Arc >.
| bool fst::ReplaceFst< A, T >::CyclicDependencies | ( | ) | const [inline] |
| virtual void fst::ReplaceFst< A, T >::InitArcIterator | ( | StateId | s, | |
| ArcIteratorData< A > * | data | |||
| ) | const [inline, virtual] |
| virtual MatcherBase<A>* fst::ReplaceFst< A, T >::InitMatcher | ( | MatchType | match_type | ) | const [inline, virtual] |
For generic matcher construction; not normally called directly by users.
Reimplemented from fst::Fst< typename ReplaceFstImpl< A, T >::Arc >.
| void fst::ReplaceFst< A, T >::InitStateIterator | ( | StateIteratorData< A > * | data | ) | const [inline, virtual] |
friend class ArcIterator< ReplaceFst< A, T > > [friend] |
friend class StateIterator< ReplaceFst< A, T > > [friend] |
1.7.1