Report null context estimates to correct score breakdown

This commit is contained in:
Kenneth Heafield 2011-10-30 17:56:42 +00:00
parent 42924144fd
commit 314313ad89

View File

@ -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);