diff options
author | Eva <eva@deimos.(none)> | 2012-04-24 08:21:41 +0400 |
---|---|---|
committer | Eva <eva@deimos.(none)> | 2012-04-24 08:21:41 +0400 |
commit | bda7894112a281e9f490f2b2538d2daa83814467 (patch) | |
tree | f44355b49df396154e58acddf7b91a5cfe5a01c8 /moses | |
parent | 3db7f5f3e92f95af7acddfd329c699819a1e5fe4 (diff) | |
parent | 98da24a3a5609074bb0913413c7b65154d8215b7 (diff) |
Merge branch 'miramerge' of thor.inf.ed.ac.uk:/fs/saxnot3/ehasler/mosesdecoder_github_mira into miramerge
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/BleuScoreFeature.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/moses/src/BleuScoreFeature.cpp b/moses/src/BleuScoreFeature.cpp index 53973080c..db2a4f568 100644 --- a/moses/src/BleuScoreFeature.cpp +++ b/moses/src/BleuScoreFeature.cpp @@ -715,7 +715,8 @@ float BleuScoreFeature::CalculateBleu(BleuScoreState* state) const { float precision_pd = 1.0; if (m_target_length_history > 0) { for (size_t i = 0; i < BleuScoreState::bleu_order; i++) - precision_pd *= m_match_history[i]/m_count_history[i]; + if (m_count_history[i] != 0) + precision_pd *= m_match_history[i]/m_count_history[i]; // take geometric mean precision_pd = pow(precision_pd, (float)1/4); |