diff options
author | Kenneth Heafield <github@kheafield.com> | 2016-08-18 00:44:24 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2016-08-18 00:44:24 +0300 |
commit | c7de0dc624f4d08337a6a7fc1f525c09f4d889c3 (patch) | |
tree | 7c56490604d3acddc0b82f666e795c98bfb998ec /moses/LM | |
parent | f260e432f55da5b1bed2c0b7036a1c43bed7bd72 (diff) | |
parent | 8bac020955a4083257104ebf2e4d61d483c29b36 (diff) |
Merge branch 'master' of github.com:moses-smt/mosesdecoder
Diffstat (limited to 'moses/LM')
-rw-r--r-- | moses/LM/Ken.cpp | 7 | ||||
-rw-r--r-- | moses/LM/PointerState.h | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/moses/LM/Ken.cpp b/moses/LM/Ken.cpp index 8de121f2f..964fb90b5 100644 --- a/moses/LM/Ken.cpp +++ b/moses/LM/Ken.cpp @@ -1,4 +1,4 @@ -// $Id$ +// $Id$\ /*********************************************************************** Moses - factored phrase-based language decoder @@ -93,6 +93,8 @@ private: template <class Model> void LanguageModelKen<Model>::LoadModel(const std::string &file, util::LoadMethod load_method) { + m_lmIdLookup.clear(); + lm::ngram::Config config; if(this->m_verbosity >= 1) { config.messages = &std::cerr; @@ -105,13 +107,12 @@ template <class Model> void LanguageModelKen<Model>::LoadModel(const std::string config.load_method = load_method; 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, util::LoadMethod load_method) :LanguageModel(line) ,m_factorType(factorType) + ,m_beginSentenceFactor(FactorCollection::Instance().AddFactor(BOS_)) { ReadParameters(); LoadModel(file, load_method); diff --git a/moses/LM/PointerState.h b/moses/LM/PointerState.h index 8bc615c40..c0e59bb45 100644 --- a/moses/LM/PointerState.h +++ b/moses/LM/PointerState.h @@ -7,6 +7,11 @@ namespace Moses struct PointerState : public FFState { const void* lmstate; + + explicit PointerState() { + // uninitialised + } + PointerState(const void* lms) { lmstate = lms; } |