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 > > 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 () 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

◆ Label

typedef Arc::Label Label

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

◆ State

typedef Store::State State

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

◆ StateId

typedef Arc::StateId StateId

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

◆ Store

typedef DefaultCacheStore<Arc> Store

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

◆ VectorToLabelIter

typedef VectorToLabelType::const_iterator VectorToLabelIter

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

◆ VectorToLabelType

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

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

◆ VectorToStateIter

typedef VectorToStateType::const_iterator VectorToStateIter

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

◆ VectorToStateType

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

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

◆ Weight

typedef Arc::Weight Weight

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

Constructor & Destructor Documentation

◆ ContextFstImpl()

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

◆ ~ContextFstImpl()

~ContextFstImpl ( )
inline

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

108 { }

Member Function Documentation

◆ ILabelInfo()

◆ IsDisambigSymbol()

bool IsDisambigSymbol ( Label  lab)
inlineprivate

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

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

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

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

◆ IsPhoneSymbol()

◆ NumOutputEpsilons()

Member Data Documentation

◆ disambig_syms_

◆ ilabel_info_

vector<vector<LabelT> > ilabel_info_
private

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

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

◆ ilabel_map_

VectorToLabelType ilabel_map_
private

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

◆ N_

◆ P_

◆ phone_syms_

◆ pseudo_eps_symbol_

int pseudo_eps_symbol_
private

◆ separator_

std::string separator_
private

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

◆ state_map_

VectorToStateType state_map_
private

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

◆ state_seqs_

◆ subsequential_symbol_


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