summaryrefslogtreecommitdiff
path: root/decoder/ff_klm.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-03-01 22:34:04 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-03-01 22:34:04 -0500
commit88c224217307f40f5361150f5bd2e8b68f51b17b (patch)
treebe7ab2fa67ade090effaa32818b157802130d7e2 /decoder/ff_klm.cc
parent4f1a0dde59051908014c056e12a175245e46794c (diff)
handle start-of-sentence correctly
Diffstat (limited to 'decoder/ff_klm.cc')
-rw-r--r--decoder/ff_klm.cc2
1 files changed, 2 insertions, 0 deletions
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);