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 DefaultCacheStore< Arc > Store
typedef Store::State State
typedef unordered_map< vector
< LabelT >, StateId,
kaldi::VectorHasher< LabelT > > 
typedef unordered_map< vector
< LabelT >, Label,
kaldi::VectorHasher< LabelT > > 

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 () const
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::internal::ContextFstImpl< Arc, LabelT >

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

Member Typedef Documentation

typedef Arc::Label Label

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

typedef Store::State State

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

typedef Arc::StateId StateId

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

typedef DefaultCacheStore<Arc> Store

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

typedef VectorToLabelType::const_iterator VectorToLabelIter

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

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

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

typedef VectorToStateType::const_iterator VectorToStateIter

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

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

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

typedef Arc::Weight Weight

Definition at line 87 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 ( )

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

108 { }

Member Function Documentation

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

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

References ContextFstImpl< Arc, LabelT >::ilabel_info_.

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

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

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

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

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

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

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

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

125 { return 0; }

Member Data Documentation

kaldi::ConstIntegerSet<Label> disambig_syms_

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

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

vector<vector<LabelT> > ilabel_info_

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

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

VectorToLabelType ilabel_map_

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

int N_

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

int P_

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

kaldi::ConstIntegerSet<Label> phone_syms_

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

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

int pseudo_eps_symbol_

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

std::string separator_

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

VectorToStateType state_map_

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

vector<vector<LabelT> > state_seqs_

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

Label subsequential_symbol_

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

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