diff options
author | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-03-29 14:10:51 +0300 |
---|---|---|
committer | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-03-29 14:10:51 +0300 |
commit | 789a2e2bc32eb94beca02fadcbab0780707a260c (patch) | |
tree | 99fbe7d317006856a6706c0ed148fecc6d9704d1 /mert/BleuScorer.cpp | |
parent | 6fa57a1dacdc985ebadc0294805f299856fa7bad (diff) |
Fix some compile warnings (gcc 4.9.2).
Mostly signed/unsigned comparisons and reordered member
initializations; also a few unused variables.
There are more, but if I chip away at them for a while, who knows, it
may catch on and warnings may eventually become socially stigmatizing.
:)
Diffstat (limited to 'mert/BleuScorer.cpp')
-rw-r--r-- | mert/BleuScorer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp index 04f4d75c9..dab1b3ccf 100644 --- a/mert/BleuScorer.cpp +++ b/mert/BleuScorer.cpp @@ -191,7 +191,7 @@ statscore_t BleuScorer::calculateScore(const vector<ScoreStatsType>& comps) cons UTIL_THROW_IF(comps.size() != kBleuNgramOrder * 2 + 1, util::Exception, "Error"); float logbleu = 0.0; - for (int i = 0; i < kBleuNgramOrder; ++i) { + for (std::size_t i = 0; i < kBleuNgramOrder; ++i) { if (comps[2*i] == 0) { return 0.0; } @@ -249,7 +249,7 @@ float smoothedSentenceBleu UTIL_THROW_IF(stats.size() != kBleuNgramOrder * 2 + 1, util::Exception, "Error"); float logbleu = 0.0; - for (int j = 0; j < kBleuNgramOrder; j++) { + for (std::size_t j = 0; j < kBleuNgramOrder; j++) { logbleu += log(stats[2 * j] + smoothing) - log(stats[2 * j + 1] + smoothing); } logbleu /= kBleuNgramOrder; @@ -275,7 +275,7 @@ float sentenceLevelBackgroundBleu(const std::vector<float>& sent, const std::vec // Calculate BLEU float logbleu = 0.0; - for (int j = 0; j < kBleuNgramOrder; j++) { + for (std::size_t j = 0; j < kBleuNgramOrder; j++) { logbleu += log(stats[2 * j]) - log(stats[2 * j + 1]); } logbleu /= kBleuNgramOrder; |