From 95183b5760d7f168ae093ae8f9b29740628a278f Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 3 Mar 2015 01:14:07 -0500 Subject: migration to cmake --- decoder/ff_ngrams.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'decoder/ff_ngrams.cc') diff --git a/decoder/ff_ngrams.cc b/decoder/ff_ngrams.cc index 38e1a60a..a45bd27d 100644 --- a/decoder/ff_ngrams.cc +++ b/decoder/ff_ngrams.cc @@ -33,11 +33,12 @@ struct State { } const State& operator=(const State& other) { memcpy(state, other.state, sizeof(state)); + return *this; } explicit State(const State& other, unsigned order, WordID extend) { - char om1 = order - 1; + unsigned om1 = order - 1; if (!om1) { memset(state, 0, sizeof(state)); return; } - for (char i = 1; i < om1; ++i) state[i - 1]= other.state[i]; + for (unsigned i = 1; i < om1; ++i) state[i - 1]= other.state[i]; state[om1 - 1] = extend; } const WordID& operator[](size_t i) const { return state[i]; } @@ -249,8 +250,6 @@ class NgramDetectorImpl { public: void LookupWords(const TRule& rule, const vector& ant_states, SparseVector* feats, SparseVector* est_feats, void* remnant) { - double sum = 0.0; - double est_sum = 0.0; int num_scored = 0; int num_estimated = 0; bool saw_eos = false; @@ -264,7 +263,6 @@ class NgramDetectorImpl { int unscored_ant_len = UnscoredSize(astate); for (int k = 0; k < unscored_ant_len; ++k) { const WordID cur_word = IthUnscoredWord(k, astate); - const bool is_oov = (cur_word == 0); SparseVector p; if (cur_word == kSOS_) { state = BeginSentenceState(); -- cgit v1.2.3