mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 07:42:21 +03:00
Report null context estimates to correct score breakdown
This commit is contained in:
parent
42924144fd
commit
314313ad89
@ -193,6 +193,8 @@ template <class Model> void LanguageModelKen<Model>::CalcScore(const Phrase &phr
|
||||
for (; position < phrase.GetSize(); ++position) {
|
||||
const Word &word = phrase.GetWord(position);
|
||||
if (word.IsNonTerminal()) {
|
||||
// If there's a non-terminal at 1 and we have a 5-gram LM, then positions 2 3 4 and 5 will be incomplete while position 6 is complete.
|
||||
ngramBoundary = m_ngram->Order() + position;
|
||||
*state0 = m_ngram->NullContextState();
|
||||
} else {
|
||||
lm::WordIndex index = TranslateID(word);
|
||||
|
Loading…
Reference in New Issue
Block a user