20 #ifndef KALDI_FSTEXT_FACTOR_H_ 21 #define KALDI_FSTEXT_FACTOR_H_ 35 #include <fst/fstlib.h> 36 #include <fst/fst-decl.h> 64 template<
class Arc,
class I>
65 void Factor(
const Fst<Arc> &
fst, MutableFst<Arc> *ofst,
66 std::vector<std::vector<I> > *symbols);
72 void Factor(
const Fst<Arc> &
fst, MutableFst<Arc> *ofst1,
73 MutableFst<Arc> *ofst2);
82 template<
class Arc,
class I>
84 MutableFst<Arc> *
fst);
97 template<
class Arc,
class I>
99 MutableFst<Arc> *
fst);
107 template<
class Arc,
class I>
109 MutableFst<Arc> *
fst);
130 std::vector<StatePropertiesType> *props);
fst::StdArc::StateId StateId
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
DfsOrderVisitor(std::vector< StateId > *order)
void GetStateProperties(const Fst< Arc > &fst, typename Arc::StateId max_state, std::vector< StatePropertiesType > *props)
This function works out various properties of the states in the FST, using the bit properties defined...
void InitVisit(const Fst< Arc > &fst)
unsigned char StatePropertiesType
bool ForwardOrCrossArc(StateId, const Arc &)
void CreateFactorFst(const std::vector< std::vector< I > > &sequences, MutableFst< Arc > *fst)
The function CreateFactorFst will create an FST that expands out the "factors" that are the indices o...
void Factor(const Fst< Arc > &fst, MutableFst< Arc > *ofst, std::vector< std::vector< I > > *symbols_out)
Factor identifies linear chains of states with an olabel (if any) only on the first arc of the chain...
void FinishState(StateId, StateId, const Arc *)
bool BackArc(StateId, const Arc &)
bool TreeArc(StateId, const Arc &)
bool InitState(StateId s, StateId)
std::vector< StateId > * order_
void CreateMapFst(const std::vector< I > &symbol_map, MutableFst< Arc > *fst)
CreateMapFst will create an FST representing this symbol_map.
void ExpandInputSequences(const std::vector< std::vector< I > > &sequences, MutableFst< Arc > *fst)
ExpandInputSequences expands out the input symbols into sequences of input symbols.