This class is for didactic purposes, it does not really do anything. More...
#include <deterministic-fst.h>
Public Types | |
| typedef Arc::StateId | StateId |
| typedef Arc::Weight | Weight |
| 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 | |
| LmExampleDeterministicOnDemandFst (void *lm, Label bos_symbol, Label eos_symbol) | |
| virtual StateId | Start () |
| virtual Weight | Final (StateId s) |
| We don't bother caching the final-probs, just the arcs. More... | |
| virtual 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 Member Functions | |
| size_t | GetIndex (StateId src_state, Label ilabel) |
Private Attributes | |
| void * | lm_ |
| Label | bos_symbol_ |
| Label | eos_symbol_ |
| MapType | state_map_ |
| StateId | start_state_ |
| std::vector< std::vector< Label > > | state_vec_ |
| void * | lm |
This class is for didactic purposes, it does not really do anything.
It shows how you would wrap a language model. Note: you should probably have <s> and </s> not be real words in your LM, but <s> correspond somehow to the initial-state of the LM, and </s> be encoded in the final-probs.
Definition at line 262 of file deterministic-fst.h.
| typedef Arc::Label Label |
Definition at line 266 of file deterministic-fst.h.
|
private |
Definition at line 284 of file deterministic-fst.h.
| typedef Arc::StateId StateId |
Definition at line 264 of file deterministic-fst.h.
| typedef Arc::Weight Weight |
Definition at line 265 of file deterministic-fst.h.
| LmExampleDeterministicOnDemandFst | ( | void * | lm, |
| Label | bos_symbol, | ||
| Label | eos_symbol | ||
| ) |
Definition at line 259 of file deterministic-fst-inl.h.
References LmExampleDeterministicOnDemandFst< Arc >::start_state_, LmExampleDeterministicOnDemandFst< Arc >::state_map_, and LmExampleDeterministicOnDemandFst< Arc >::state_vec_.
|
virtual |
We don't bother caching the final-probs, just the arcs.
Implements DeterministicOnDemandFst< Arc >.
Definition at line 272 of file deterministic-fst-inl.h.
References KALDI_ASSERT, and LmExampleDeterministicOnDemandFst< Arc >::state_vec_.
Referenced by fst::TestCompose().
Note: ilabel must not be epsilon.
Implements DeterministicOnDemandFst< Arc >.
Definition at line 282 of file deterministic-fst-inl.h.
References KALDI_ASSERT, LmExampleDeterministicOnDemandFst< Arc >::state_map_, and LmExampleDeterministicOnDemandFst< Arc >::state_vec_.
Referenced by fst::TestCompose().
|
inlinevirtual |
Implements DeterministicOnDemandFst< Arc >.
Definition at line 273 of file deterministic-fst.h.
References DeterministicOnDemandFst< Arc >::Final(), and DeterministicOnDemandFst< Arc >::GetArc().
Referenced by fst::TestCompose().
|
private |
Definition at line 286 of file deterministic-fst.h.
|
private |
Definition at line 287 of file deterministic-fst.h.
|
private |
Definition at line 294 of file deterministic-fst.h.
|
private |
Definition at line 285 of file deterministic-fst.h.
|
private |
Definition at line 291 of file deterministic-fst.h.
Referenced by LmExampleDeterministicOnDemandFst< Arc >::LmExampleDeterministicOnDemandFst().
|
private |
Definition at line 290 of file deterministic-fst.h.
Referenced by LmExampleDeterministicOnDemandFst< Arc >::GetArc(), and LmExampleDeterministicOnDemandFst< Arc >::LmExampleDeterministicOnDemandFst().
|
private |
Definition at line 292 of file deterministic-fst.h.
Referenced by LmExampleDeterministicOnDemandFst< Arc >::Final(), LmExampleDeterministicOnDemandFst< Arc >::GetArc(), and LmExampleDeterministicOnDemandFst< Arc >::LmExampleDeterministicOnDemandFst().