mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-06 19:49:41 +03:00
m_sos -> m_bos
This commit is contained in:
parent
b4ee52ff76
commit
ee85a0860c
@ -67,7 +67,7 @@ void KENLM::Load(System &system)
|
||||
{
|
||||
Moses::FactorCollection &fc = system.GetVocab();
|
||||
|
||||
m_sos = fc.AddFactor("<s>", false);
|
||||
m_bos = fc.AddFactor("<s>", false);
|
||||
m_eos = fc.AddFactor("</s>", false);
|
||||
|
||||
lm::ngram::Config config;
|
||||
@ -160,7 +160,7 @@ void KENLM::CalcScore(const Phrase &phrase, float &fullScore, float &ngramScore,
|
||||
lm::ngram::RuleScore<Model> 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 {
|
||||
|
@ -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;
|
||||
|
@ -57,7 +57,7 @@ void LanguageModel::Load(System &system)
|
||||
{
|
||||
Moses::FactorCollection &fc = system.GetVocab();
|
||||
|
||||
m_sos = fc.AddFactor("<s>", false);
|
||||
m_bos = fc.AddFactor("<s>", false);
|
||||
m_eos = fc.AddFactor("</s>", 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>()) LMState(pool, m_sos);
|
||||
return new (pool.Allocate<LMState>()) LMState(pool, m_bos);
|
||||
}
|
||||
|
||||
void
|
||||
@ -136,7 +136,7 @@ LanguageModel::EvaluateInIsolation(const System &system,
|
||||
SCORE score = 0;
|
||||
SCORE nonFullScore = 0;
|
||||
vector<const Moses::Factor*> context;
|
||||
// context.push_back(m_sos);
|
||||
// context.push_back(m_bos);
|
||||
|
||||
context.reserve(m_order);
|
||||
for (size_t i = 0; i < targetPhrase.GetSize(); ++i) {
|
||||
|
@ -70,7 +70,7 @@ protected:
|
||||
|
||||
MorphTrie<const Moses::Factor*, LMScores> m_root;
|
||||
SCORE m_oov;
|
||||
const Moses::Factor *m_sos;
|
||||
const Moses::Factor *m_bos;
|
||||
const Moses::Factor *m_eos;
|
||||
|
||||
void ShiftOrPush(std::vector<const Moses::Factor*> &context, const Moses::Factor *factor) const;
|
||||
|
Loading…
Reference in New Issue
Block a user