The class UnweightedNgramFst is a DeterministicOnDemandFst whose states encode an n-gram history. More...
#include <deterministic-fst.h>
Public Types | |
typedef Arc::Weight | Weight |
typedef Arc::StateId | StateId |
typedef Arc::Label | Label |
Public Types inherited from DeterministicOnDemandFst< Arc > | |
typedef Arc::StateId | StateId |
typedef Arc::Weight | Weight |
typedef Arc::Label | Label |
Public Member Functions | |
UnweightedNgramFst (int n) | |
StateId | Start () |
Weight | Final (StateId s) |
bool | GetArc (StateId s, Label ilabel, Arc *oarc) |
Note: ilabel must not be epsilon. More... | |
Public Member Functions inherited from DeterministicOnDemandFst< Arc > | |
virtual | ~DeterministicOnDemandFst () |
Private Types | |
typedef unordered_map< std::vector< Label >, StateId, kaldi::VectorHasher< Label > > | MapType |
Private Attributes | |
int | n_ |
MapType | state_map_ |
StateId | start_state_ |
std::vector< std::vector< Label > > | state_vec_ |
The class UnweightedNgramFst is a DeterministicOnDemandFst whose states encode an n-gram history.
Conceptually, for n-gram order n and k labels, the FST is an unweighted acceptor with about k^(n-1) states (ignoring end effects). However, the FST is created on demand and doesn't need the label vocabulary; GetArc matches on any input label. This class is primarily used together with ComposeDeterministicOnDemandFst to expand the n-gram history of lattices, ensuring that each arc has a sufficiently long unique word history.
Definition at line 173 of file deterministic-fst.h.
typedef Arc::Label Label |
Definition at line 177 of file deterministic-fst.h.
|
private |
Definition at line 189 of file deterministic-fst.h.
typedef Arc::StateId StateId |
Definition at line 176 of file deterministic-fst.h.
typedef Arc::Weight Weight |
Definition at line 175 of file deterministic-fst.h.
UnweightedNgramFst | ( | int | n | ) |
Definition at line 89 of file deterministic-fst-inl.h.
References UnweightedNgramFst< Arc >::start_state_, UnweightedNgramFst< Arc >::state_map_, and UnweightedNgramFst< Arc >::state_vec_.
|
virtual |
Implements DeterministicOnDemandFst< Arc >.
Definition at line 130 of file deterministic-fst-inl.h.
References KALDI_ASSERT, and UnweightedNgramFst< Arc >::state_vec_.
Note: ilabel must not be epsilon.
Implements DeterministicOnDemandFst< Arc >.
Definition at line 98 of file deterministic-fst-inl.h.
References KALDI_ASSERT, UnweightedNgramFst< Arc >::n_, UnweightedNgramFst< Arc >::state_map_, and UnweightedNgramFst< Arc >::state_vec_.
|
inlinevirtual |
Implements DeterministicOnDemandFst< Arc >.
Definition at line 181 of file deterministic-fst.h.
References DeterministicOnDemandFst< Arc >::Final(), and DeterministicOnDemandFst< Arc >::GetArc().
|
private |
Definition at line 191 of file deterministic-fst.h.
Referenced by UnweightedNgramFst< Arc >::GetArc().
|
private |
Definition at line 193 of file deterministic-fst.h.
Referenced by UnweightedNgramFst< Arc >::UnweightedNgramFst().
|
private |
Definition at line 192 of file deterministic-fst.h.
Referenced by UnweightedNgramFst< Arc >::GetArc(), and UnweightedNgramFst< Arc >::UnweightedNgramFst().
|
private |
Definition at line 195 of file deterministic-fst.h.
Referenced by UnweightedNgramFst< Arc >::Final(), UnweightedNgramFst< Arc >::GetArc(), and UnweightedNgramFst< Arc >::UnweightedNgramFst().