#include <SRI.h>
Public Member Functions | |
LanguageModelSRI (const std::string &line) | |
~LanguageModelSRI () | |
void | Load (AllOptions::ptr const &opts) |
override to load model files | |
virtual LMResult | GetValue (const std::vector< const Word * > &contextFactor, State *finalState=0) const |
Protected Member Functions | |
LMResult | GetValue (unsigned int wordId, unsigned int *context) const |
void | CreateFactors () |
unsigned int | GetLmID (const std::string &str) const |
unsigned int | GetLmID (const Factor *factor) const |
Protected Attributes | |
std::vector< unsigned int > | m_lmIdLookup |
::Vocab * | m_srilmVocab |
Ngram * | m_srilmModel |
unsigned int | m_unknownId |
Definition at line 41 of file SRI.h.
Moses::LanguageModelSRI::LanguageModelSRI | ( | const std::string & | line | ) |
Definition at line 55 of file SRI.cpp.
References Moses::FeatureFunction::ReadParameters().
Moses::LanguageModelSRI::~LanguageModelSRI | ( | ) |
void Moses::LanguageModelSRI::CreateFactors | ( | ) | [protected] |
Definition at line 84 of file SRI.cpp.
References Moses::FactorCollection::AddFactor(), BOS_, EOS_, fill(), Moses::Factor::GetId(), GetLmID(), Moses::FactorCollection::Instance(), lmIdMap, Moses::LanguageModelSingleFactor::m_factorType, m_lmIdLookup, Moses::LanguageModelSingleFactor::m_sentenceEnd, Moses::LanguageModelImplementation::m_sentenceEndWord, Moses::LanguageModelSingleFactor::m_sentenceStart, Moses::LanguageModelImplementation::m_sentenceStartWord, m_srilmVocab, m_unknownId, NULL, Moses::Output, and str.
Referenced by Load().
VocabIndex Moses::LanguageModelSRI::GetLmID | ( | const Factor * | factor | ) | const [protected] |
Definition at line 130 of file SRI.cpp.
References Moses::Factor::GetId(), m_lmIdLookup, and m_unknownId.
VocabIndex Moses::LanguageModelSRI::GetLmID | ( | const std::string & | str | ) | const [protected] |
Definition at line 126 of file SRI.cpp.
References m_srilmVocab, and m_unknownId.
Referenced by CreateFactors().
virtual LMResult Moses::LanguageModelSRI::GetValue | ( | const std::vector< const Word * > & | contextFactor, | |
State * | finalState = 0 | |||
) | const [virtual] |
Implements Moses::LanguageModelSingleFactor.
LMResult Moses::LanguageModelSRI::GetValue | ( | unsigned int | wordId, | |
unsigned int * | context | |||
) | const [protected] |
void Moses::LanguageModelSRI::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 69 of file SRI.cpp.
References CreateFactors(), Moses::LanguageModelImplementation::m_filePath, Moses::LanguageModelImplementation::m_nGramOrder, m_srilmModel, m_srilmVocab, and m_unknownId.
std::vector<unsigned int> Moses::LanguageModelSRI::m_lmIdLookup [protected] |
Ngram* Moses::LanguageModelSRI::m_srilmModel [protected] |
::Vocab* Moses::LanguageModelSRI::m_srilmVocab [protected] |
Definition at line 45 of file SRI.h.
Referenced by CreateFactors(), GetLmID(), Load(), and ~LanguageModelSRI().
unsigned int Moses::LanguageModelSRI::m_unknownId [protected] |