summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-02-23 17:32:59 -0500
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-02-23 17:32:59 -0500
commitd843587027d815f3a1c9b8dd5394f3fe04ac85fa (patch)
tree2ec166ba59736ab1b09ff9c5ab03ecf3ec6e4293 /decoder
parentdd555f71427c72753bb0a2451de05d8d7125717c (diff)
ngrams fix for unigram models
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ff_ngrams.cc4
1 files 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<MAX_ORDER>& 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 {