#include <const-arpa-lm.h>
Public Member Functions | |
ConstArpaLm () | |
ConstArpaLm (const int32 bos_symbol, const int32 eos_symbol, const int32 unk_symbol, const int32 ngram_order, const int32 num_words, const int32 overflow_buffer_size, const int64 lm_states_size, int32 **unigram_states, int32 **overflow_buffer, int32 *lm_states) | |
~ConstArpaLm () | |
void | Read (std::istream &is, bool binary) |
void | Write (std::ostream &os, bool binary) const |
void | WriteArpa (std::ostream &os) const |
float | GetNgramLogprob (const int32 word, const std::vector< int32 > &hist) const |
bool | HistoryStateExists (const std::vector< int32 > &hist) const |
int32 | BosSymbol () const |
int32 | EosSymbol () const |
int32 | UnkSymbol () const |
int32 | NgramOrder () const |
Private Member Functions | |
void | ReadInternal (std::istream &is, bool binary) |
void | ReadInternalOldFormat (std::istream &is, bool binary) |
float | GetNgramLogprobRecurse (const int32 word, const std::vector< int32 > &hist) const |
int32 * | GetLmState (const std::vector< int32 > &seq) const |
bool | GetChildInfo (const int32 word, int32 *parent, int32 *child_info) const |
void | DecodeChildInfo (const int32 child_info, int32 *parent, int32 **child_lm_state, float *logprob) const |
void | WriteArpaRecurse (int32 *lm_state, const std::vector< int32 > &seq, std::vector< ArpaLine > *output) const |
Private Attributes | |
bool | memory_assigned_ |
bool | initialized_ |
int32 | bos_symbol_ |
int32 | eos_symbol_ |
int32 | unk_symbol_ |
int32 | ngram_order_ |
int32 | num_words_ |
int32 | overflow_buffer_size_ |
int64 | lm_states_size_ |
int32 * | lm_states_end_ |
int32 ** | unigram_states_ |
int32 ** | overflow_buffer_ |
int32 * | lm_states_ |
Definition at line 211 of file const-arpa-lm.h.
|
inline |
Definition at line 216 of file const-arpa-lm.h.
|
inline |
|
inline |
Definition at line 249 of file const-arpa-lm.h.
|
inline |
Definition at line 276 of file const-arpa-lm.h.
Referenced by ConstArpaLmDeterministicFst::ConstArpaLmDeterministicFst().
|
private |
|
inline |
Definition at line 821 of file const-arpa-lm.cc.
References rnnlm::i, KALDI_ASSERT, and ArpaLine::logprob.
Definition at line 748 of file const-arpa-lm.cc.
References rnnlm::i, and KALDI_ASSERT.
Referenced by ConstArpaLmDeterministicFst::Final(), and ConstArpaLmDeterministicFst::GetArc().
Definition at line 783 of file const-arpa-lm.cc.
References ArpaLine::backoff_logprob, Int32AndFloat::f, KALDI_ASSERT, and ArpaLine::logprob.
Definition at line 721 of file const-arpa-lm.cc.
References KALDI_ASSERT.
Referenced by ConstArpaLmDeterministicFst::GetArc().
|
inline |
Definition at line 279 of file const-arpa-lm.h.
References logprob.
Referenced by ConstArpaLmDeterministicFst::GetArc().
void Read | ( | std::istream & | is, |
bool | binary | ||
) |
Definition at line 573 of file const-arpa-lm.cc.
References KALDI_ASSERT, and KALDI_ERR.
|
private |
Definition at line 587 of file const-arpa-lm.cc.
References kaldi::ExpectToken(), rnnlm::i, KALDI_ASSERT, KALDI_ERR, and kaldi::ReadBasicType().
|
private |
Definition at line 665 of file const-arpa-lm.cc.
References rnnlm::i, KALDI_ASSERT, KALDI_ERR, and kaldi::ReadBasicType().
|
inline |
Definition at line 278 of file const-arpa-lm.h.
void Write | ( | std::ostream & | os, |
bool | binary | ||
) | const |
Definition at line 497 of file const-arpa-lm.cc.
References rnnlm::i, KALDI_ASSERT, KALDI_ERR, kaldi::WriteBasicType(), and kaldi::WriteToken().
Referenced by ConstArpaLmBuilder::Write().
void WriteArpa | ( | std::ostream & | os | ) | const |
Definition at line 952 of file const-arpa-lm.cc.
References ArpaLine::backoff_logprob, rnnlm::i, rnnlm::j, KALDI_ASSERT, and ArpaLine::words.
|
private |
Definition at line 911 of file const-arpa-lm.cc.
References ArpaLine::backoff_logprob, Int32AndFloat::f, rnnlm::i, KALDI_ASSERT, ArpaLine::logprob, and ArpaLine::words.
|
private |
Definition at line 332 of file const-arpa-lm.h.
|
private |
Definition at line 335 of file const-arpa-lm.h.
|
private |
Definition at line 329 of file const-arpa-lm.h.
|
private |
Definition at line 384 of file const-arpa-lm.h.
|
private |
Definition at line 357 of file const-arpa-lm.h.
|
private |
Definition at line 353 of file const-arpa-lm.h.
|
private |
Definition at line 326 of file const-arpa-lm.h.
|
private |
Definition at line 342 of file const-arpa-lm.h.
|
private |
Definition at line 346 of file const-arpa-lm.h.
|
private |
Definition at line 368 of file const-arpa-lm.h.
|
private |
Definition at line 350 of file const-arpa-lm.h.
|
private |
Definition at line 362 of file const-arpa-lm.h.
|
private |
Definition at line 339 of file const-arpa-lm.h.