fix precision

git-svn-id: http://svn.statmt.org/repository/mira@3808 cc96ff50-19ce-11e0-b349-13d7f0bd23df
This commit is contained in:
ehasler 2011-02-27 14:08:02 +00:00 committed by Ondrej Bojar
parent eeba3547cd
commit 0993dde7ce

View File

@ -461,9 +461,9 @@ vector<float> BleuScoreFeature::CalculateBleuOfCorpus(const vector< vector< cons
// = BP * 4th root(PRODUCT_1_4 p_n)
for (size_t i = 0; i < BleuScoreState::bleu_order; i++) {
if (sumOfNgramCounts[i]) {
precision *= sumOfClippedNgramMatches[i] / sumOfNgramCounts[i];
bleu.push_back(sumOfClippedNgramMatches[i] / sumOfNgramCounts[i]);
}
precision *= 1.0*sumOfClippedNgramMatches[i] / sumOfNgramCounts[i];
bleu.push_back(1.0*sumOfClippedNgramMatches[i] / sumOfNgramCounts[i]);
}
}
// take geometric mean