From 3524a33c3f2612c643a020437356846895504407 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 23 Feb 2014 17:32:59 -0500 Subject: ngrams fix for unigram models --- decoder/ff_ngrams.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decoder/ff_ngrams.cc b/decoder/ff_ngrams.cc index 0bc14e5a..0a97cba5 100644 --- a/decoder/ff_ngrams.cc +++ b/decoder/ff_ngrams.cc @@ -36,7 +36,7 @@ struct State { } explicit State(const State& other, unsigned order, WordID extend) { char om1 = order - 1; - assert(om1 > 0); + if (!om1) { memset(state, 0, sizeof(state)); return; } for (char i = 1; i < om1; ++i) state[i - 1]= other.state[i]; state[om1 - 1] = extend; } @@ -152,7 +152,7 @@ usage: << "Example feature instantiation: \n" << " tri:a|b|c \n\n"; - return false; + abort(); } class NgramDetectorImpl { -- cgit v1.2.3