From c6536a134b21545f6f64794abba6dd789cb8fdfe Mon Sep 17 00:00:00 2001 From: Tetsuo Kiso Date: Wed, 14 Mar 2012 22:44:51 +0900 Subject: [PATCH] Clean up BleuScorer. --- mert/BleuScorer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp index 72710686d..4063d9acf 100644 --- a/mert/BleuScorer.cpp +++ b/mert/BleuScorer.cpp @@ -141,16 +141,16 @@ void BleuScorer::prepareStats(size_t sid, const string& text, ScoreStats& entry) //precision on each ngram type for (NgramCounts::const_iterator testcounts_it = testcounts.begin(); testcounts_it != testcounts.end(); ++testcounts_it) { - int correct = 0; - const int guess = testcounts_it->second; + const NgramCounts::Value guess = testcounts_it->second; + const size_t len = testcounts_it->first.size(); + NgramCounts::Value correct = 0; NgramCounts::Value v = 0; if (m_ref_counts[sid]->lookup(testcounts_it->first, &v)) { correct = min(v, guess); } - const size_t len = testcounts_it->first.size(); - stats[len*2-2] += correct; - stats[len*2-1] += guess; + stats[len * 2 - 2] += correct; + stats[len * 2 - 1] += guess; } entry.set(stats); }