From 88c224217307f40f5361150f5bd2e8b68f51b17b Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 1 Mar 2011 22:34:04 -0500 Subject: handle start-of-sentence correctly --- decoder/ff_klm.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'decoder') diff --git a/decoder/ff_klm.cc b/decoder/ff_klm.cc index f262229b..9ba2cbaa 100644 --- a/decoder/ff_klm.cc +++ b/decoder/ff_klm.cc @@ -84,6 +84,7 @@ class KLanguageModelImpl { if (cur_word == kSOS_) { if (state.ValidLength() > 0) { p = -100; } state = ngram_->BeginSentenceState(); + context_complete = true; } else { const lm::ngram::State scopy(state); p = ngram_->Score(scopy, cur_word, state); @@ -111,6 +112,7 @@ class KLanguageModelImpl { if (cur_word == kSOS_) { if (state.ValidLength() > 0) p = -100; state = ngram_->BeginSentenceState(); + context_complete = true; } else { const lm::ngram::State scopy(state); p = ngram_->Score(scopy, cur_word, state); -- cgit v1.2.3