From ee85a0860c8fbe66a1dd0189212ae8d95129b026 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 4 Nov 2015 14:55:18 +0000 Subject: [PATCH] m_sos -> m_bos --- contrib/other-builds/moses2/LM/KENLM.cpp | 4 ++-- contrib/other-builds/moses2/LM/KENLM.h | 2 +- contrib/other-builds/moses2/LM/LanguageModel.cpp | 6 +++--- contrib/other-builds/moses2/LM/LanguageModel.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/other-builds/moses2/LM/KENLM.cpp b/contrib/other-builds/moses2/LM/KENLM.cpp index ffda87d9e..d3ed5bb1c 100644 --- a/contrib/other-builds/moses2/LM/KENLM.cpp +++ b/contrib/other-builds/moses2/LM/KENLM.cpp @@ -67,7 +67,7 @@ void KENLM::Load(System &system) { Moses::FactorCollection &fc = system.GetVocab(); - m_sos = fc.AddFactor("", false); + m_bos = fc.AddFactor("", false); m_eos = fc.AddFactor("", false); lm::ngram::Config config; @@ -160,7 +160,7 @@ void KENLM::CalcScore(const Phrase &phrase, float &fullScore, float &ngramScore, lm::ngram::RuleScore scorer(*m_ngram, discarded_sadly); size_t position; - if (m_sos == phrase[0][m_factorType]) { + if (m_bos == phrase[0][m_factorType]) { scorer.BeginSentence(); position = 1; } else { diff --git a/contrib/other-builds/moses2/LM/KENLM.h b/contrib/other-builds/moses2/LM/KENLM.h index d324ec985..fdde1c747 100644 --- a/contrib/other-builds/moses2/LM/KENLM.h +++ b/contrib/other-builds/moses2/LM/KENLM.h @@ -42,7 +42,7 @@ public: protected: std::string m_path; Moses::FactorType m_factorType; - const Moses::Factor *m_sos; + const Moses::Factor *m_bos; const Moses::Factor *m_eos; typedef lm::ngram::ProbingModel Model; diff --git a/contrib/other-builds/moses2/LM/LanguageModel.cpp b/contrib/other-builds/moses2/LM/LanguageModel.cpp index 534c9274e..82a9a6509 100644 --- a/contrib/other-builds/moses2/LM/LanguageModel.cpp +++ b/contrib/other-builds/moses2/LM/LanguageModel.cpp @@ -57,7 +57,7 @@ void LanguageModel::Load(System &system) { Moses::FactorCollection &fc = system.GetVocab(); - m_sos = fc.AddFactor("", false); + m_bos = fc.AddFactor("", false); m_eos = fc.AddFactor("", false); Moses::InputFileStream infile(m_path); @@ -120,7 +120,7 @@ void LanguageModel::SetParameter(const std::string& key, const std::string& valu const Moses::FFState* LanguageModel::EmptyHypothesisState(const Manager &mgr, const PhraseImpl &input) const { MemPool &pool = mgr.GetPool(); - return new (pool.Allocate()) LMState(pool, m_sos); + return new (pool.Allocate()) LMState(pool, m_bos); } void @@ -136,7 +136,7 @@ LanguageModel::EvaluateInIsolation(const System &system, SCORE score = 0; SCORE nonFullScore = 0; vector context; -// context.push_back(m_sos); +// context.push_back(m_bos); context.reserve(m_order); for (size_t i = 0; i < targetPhrase.GetSize(); ++i) { diff --git a/contrib/other-builds/moses2/LM/LanguageModel.h b/contrib/other-builds/moses2/LM/LanguageModel.h index eefab8d34..a7246e98d 100644 --- a/contrib/other-builds/moses2/LM/LanguageModel.h +++ b/contrib/other-builds/moses2/LM/LanguageModel.h @@ -70,7 +70,7 @@ protected: MorphTrie m_root; SCORE m_oov; - const Moses::Factor *m_sos; + const Moses::Factor *m_bos; const Moses::Factor *m_eos; void ShiftOrPush(std::vector &context, const Moses::Factor *factor) const;