mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-13 00:59:02 +03:00
Bug Fix
This commit is contained in:
parent
8c19c2ba8a
commit
6a915253e1
@ -23,7 +23,7 @@ void OpSequenceModel :: readLanguageModel(const char *lmFile)
|
||||
string unkOp = "_TRANS_SLF_";
|
||||
|
||||
|
||||
//*
|
||||
/*
|
||||
|
||||
// Code for SRILM
|
||||
|
||||
@ -35,20 +35,14 @@ void OpSequenceModel :: readLanguageModel(const char *lmFile)
|
||||
numbers.push_back(ptrOp->getLMID(const_cast <char *> (unkOp.c_str())));
|
||||
unkOpProb = ptrOp->contextProbN(numbers,nonWordFlag);
|
||||
|
||||
//*/
|
||||
*/
|
||||
|
||||
// Code to load KenLM
|
||||
|
||||
OSM = new Model(m_lmPath.c_str());
|
||||
|
||||
/*
|
||||
State startState = OSM->EmptyContextState();
|
||||
State startState = OSM->BeginSentenceState();
|
||||
State endState;
|
||||
unkOpProb = OSM->Score(startState,OSM->GetVocabulary().Index(unkOp),endState);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,8 +17,7 @@ class OpSequenceModel : public StatefulFeatureFunction
|
||||
{
|
||||
public:
|
||||
|
||||
//LM *LanguageModel;
|
||||
|
||||
|
||||
lm::ngram::Model * OSM;
|
||||
|
||||
Api * ptrOp;
|
||||
|
@ -383,9 +383,10 @@ LanguageModel *ConstructKenLM(const std::string &description, const std::string
|
||||
try {
|
||||
lm::ngram::ModelType model_type;
|
||||
if (lm::ngram::RecognizeBinary(file.c_str(), model_type)) {
|
||||
|
||||
switch(model_type) {
|
||||
case lm::ngram::PROBING:
|
||||
return new LanguageModelKen<lm::ngram::ProbingModel>(description, line, file, factorType, lazy);
|
||||
return new LanguageModelKen<lm::ngram::ProbingModel>(description, line, file, factorType, lazy);
|
||||
case lm::ngram::REST_PROBING:
|
||||
return new LanguageModelKen<lm::ngram::RestProbingModel>(description, line, file, factorType, lazy);
|
||||
case lm::ngram::TRIE:
|
||||
|
Loading…
Reference in New Issue
Block a user