Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses/LM
diff options
context:
space:
mode:
authorLane Schwartz <Lane Schwartz>2016-03-23 18:25:57 +0300
committerLane Schwartz <Lane Schwartz>2016-03-23 18:25:57 +0300
commit8893524339f15f99e3833785f893885e3c416e66 (patch)
tree9d9819ab413f72eee957e7b15fa6bc74a264812e /moses/LM
parent10debb4906e65981b2f5e59e4858f1498aaa660f (diff)
Fixed bug
Diffstat (limited to 'moses/LM')
-rw-r--r--moses/LM/Ken.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/moses/LM/Ken.cpp b/moses/LM/Ken.cpp
index c81f3b859..ef2b03131 100644
--- a/moses/LM/Ken.cpp
+++ b/moses/LM/Ken.cpp
@@ -1,4 +1,4 @@
-// $Id$
+// $Id$\
/***********************************************************************
Moses - factored phrase-based language decoder
@@ -150,6 +150,8 @@ private:
template <class Model> void LanguageModelKen<Model>::LoadModel(const std::string &file, bool lazy)
{
+ m_lmIdLookup.clear();
+
lm::ngram::Config config;
if(this->m_verbosity >= 1) {
config.messages = &std::cerr;
@@ -162,13 +164,12 @@ template <class Model> void LanguageModelKen<Model>::LoadModel(const std::string
config.load_method = lazy ? util::LAZY : util::POPULATE_OR_READ;
m_ngram.reset(new Model(file.c_str(), config));
-
- m_beginSentenceFactor = collection.AddFactor(BOS_);
}
template <class Model> LanguageModelKen<Model>::LanguageModelKen(const std::string &line, const std::string &file, FactorType factorType, bool lazy)
:LanguageModel(line)
,m_factorType(factorType)
+ ,m_beginSentenceFactor(FactorCollection::Instance().AddFactor(BOS_))
{
ReadParameters();
LoadModel(file, lazy);