Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2012-02-01 12:17:58 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-02-01 12:17:58 +0400
commit142342f8be02648e101fd53441b5d43cdfbb0826 (patch)
tree5979f634a4a4d75d0b9f022b6bd38ef47d557d26 /mert/BleuScorer.cpp
parent3c04b7e826df624d269df499433b9b19d3611dae (diff)
Change casts to C++ style casts, and delete unnecessary casts.
Diffstat (limited to 'mert/BleuScorer.cpp')
-rw-r--r--mert/BleuScorer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp
index 67692eef7..45bd635bb 100644
--- a/mert/BleuScorer.cpp
+++ b/mert/BleuScorer.cpp
@@ -142,7 +142,7 @@ void BleuScorer::prepareStats(size_t sid, const string& text, ScoreStats& entry)
for (size_t i = 0; i < _reflengths[sid].size(); ++i) {
total += _reflengths[sid][i];
}
- float mean = (float)total/_reflengths[sid].size();
+ float mean = static_cast<float>(total) /_reflengths[sid].size();
stats.push_back(mean);
} else if (_refLengthStrategy == BLEU_CLOSEST) {
int min_diff = INT_MAX;
@@ -196,7 +196,7 @@ float BleuScorer::calculateScore(const vector<int>& comps) const
}
logbleu /= kLENGTH;
- float brevity = 1.0 - (float)comps[kLENGTH*2]/comps[1];//reflength divided by test length
+ const float brevity = 1.0 - static_cast<float>(comps[kLENGTH*2]) / comps[1];//reflength divided by test length
if (brevity < 0.0) {
logbleu += brevity;
}