All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ContextFstImpl< Arc, LabelT > Class Template Reference

#include <context-fst.h>

Inheritance diagram for ContextFstImpl< Arc, LabelT >:
Collaboration diagram for ContextFstImpl< Arc, LabelT >:

Public Types

typedef Arc::Weight Weight
 
typedef Arc::StateId StateId
 
typedef Arc::Label Label
 
typedef unordered_map< vector
< LabelT >, StateId,
kaldi::VectorHasher< LabelT > > 
VectorToStateType
 
typedef unordered_map< vector
< LabelT >, Label,
kaldi::VectorHasher< LabelT > > 
VectorToLabelType
 
typedef
VectorToStateType::const_iterator 
VectorToStateIter
 
typedef
VectorToLabelType::const_iterator 
VectorToLabelIter
 

Public Member Functions

 ContextFstImpl (Label subsequential_symbol, const vector< LabelT > &phones, const vector< LabelT > &disambig_syms, int32 N, int32 P)
 
 ContextFstImpl (const ContextFstImpl &other)
 
 ~ContextFstImpl ()
 
const vector< vector< LabelT > > & ILabelInfo ()
 
StateId Start ()
 
Weight Final (StateId s)
 
size_t NumArcs (StateId s)
 
size_t NumInputEpsilons (StateId s)
 
size_t NumOutputEpsilons (StateId s)
 
void InitArcIterator (StateId s, ArcIteratorData< Arc > *data)
 
bool CreateArc (StateId s, Label olabel, Arc *oarc)
 
void Expand (StateId s)
 

Private Member Functions

StateId FindState (const vector< LabelT > &seq)
 Finds state-id corresponding to this vector of phones. Inserts it if necessary. More...
 
Label FindLabel (const vector< LabelT > &label_info)
 Finds the label index corresponding to this context-window of phones. More...
 
bool IsDisambigSymbol (Label lab)
 
bool IsPhoneSymbol (Label lab)
 
void CreateDisambigArc (StateId s, Label olabel, Arc *oarc)
 
bool CreatePhoneOrEpsArc (StateId src, StateId dst, Label olabel, const vector< LabelT > &phone_seq, Arc *oarc)
 

Private Attributes

VectorToStateType state_map_
 
vector< vector< LabelT > > state_seqs_
 
VectorToLabelType ilabel_map_
 
vector< vector< LabelT > > ilabel_info_
 
kaldi::ConstIntegerSet< Labelphone_syms_
 
kaldi::ConstIntegerSet< Labeldisambig_syms_
 
Label subsequential_symbol_
 
int N_
 
int P_
 
int pseudo_eps_symbol_
 
std::string separator_
 

Detailed Description

template<class Arc, class LabelT = int32>
class fst::ContextFstImpl< Arc, LabelT >

Definition at line 83 of file context-fst.h.

Member Typedef Documentation

typedef Arc::Label Label

Definition at line 96 of file context-fst.h.

typedef Arc::StateId StateId

Definition at line 95 of file context-fst.h.

typedef VectorToLabelType::const_iterator VectorToLabelIter

Definition at line 107 of file context-fst.h.

typedef unordered_map<vector<LabelT>, Label, kaldi::VectorHasher<LabelT> > VectorToLabelType

Definition at line 104 of file context-fst.h.

typedef VectorToStateType::const_iterator VectorToStateIter

Definition at line 106 of file context-fst.h.

typedef unordered_map<vector<LabelT>, StateId, kaldi::VectorHasher<LabelT> > VectorToStateType

Definition at line 102 of file context-fst.h.

typedef Arc::Weight Weight

Definition at line 94 of file context-fst.h.

Constructor & Destructor Documentation

ContextFstImpl ( Label  subsequential_symbol,
const vector< LabelT > &  phones,
const vector< LabelT > &  disambig_syms,
int32  N,
int32  P 
)
~ContextFstImpl ( )
inline

Definition at line 117 of file context-fst.h.

117 { }

Member Function Documentation

const vector<vector<LabelT> >& ILabelInfo ( )
inline

Definition at line 122 of file context-fst.h.

References ContextFstImpl< Arc, LabelT >::ilabel_info_.

122 { return ilabel_info_; }
vector< vector< LabelT > > ilabel_info_
Definition: context-fst.h:175
bool IsDisambigSymbol ( Label  lab)
inlineprivate

Definition at line 159 of file context-fst.h.

References ConstIntegerSet< I >::count(), and ContextFstImpl< Arc, LabelT >::disambig_syms_.

159 { return (disambig_syms_.count(lab) != 0); }
kaldi::ConstIntegerSet< Label > disambig_syms_
Definition: context-fst.h:179
bool IsPhoneSymbol ( Label  lab)
inlineprivate

Definition at line 162 of file context-fst.h.

References ConstIntegerSet< I >::count(), and ContextFstImpl< Arc, LabelT >::phone_syms_.

162 { return (phone_syms_.count(lab) != 0); }
kaldi::ConstIntegerSet< Label > phone_syms_
Definition: context-fst.h:178
size_t NumOutputEpsilons ( StateId  s)
inline

Definition at line 134 of file context-fst.h.

134 { return 0; }

Member Data Documentation

kaldi::ConstIntegerSet<Label> disambig_syms_
private

Definition at line 179 of file context-fst.h.

Referenced by ContextFstImpl< Arc, LabelT >::IsDisambigSymbol().

vector<vector<LabelT> > ilabel_info_
private

Definition at line 175 of file context-fst.h.

Referenced by ContextFstImpl< Arc, LabelT >::ILabelInfo().

VectorToLabelType ilabel_map_
private

Definition at line 174 of file context-fst.h.

int N_
private

Definition at line 181 of file context-fst.h.

int P_
private

Definition at line 182 of file context-fst.h.

kaldi::ConstIntegerSet<Label> phone_syms_
private

Definition at line 178 of file context-fst.h.

Referenced by ContextFstImpl< Arc, LabelT >::IsPhoneSymbol().

int pseudo_eps_symbol_
private

Definition at line 183 of file context-fst.h.

std::string separator_
private

Definition at line 192 of file context-fst.h.

VectorToStateType state_map_
private

Definition at line 170 of file context-fst.h.

vector<vector<LabelT> > state_seqs_
private

Definition at line 171 of file context-fst.h.

Label subsequential_symbol_
private

Definition at line 180 of file context-fst.h.


The documentation for this class was generated from the following files: