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:
authorArianna Bisazza <arianna.bis@gmail.com>2012-10-08 19:15:59 +0400
committerArianna Bisazza <arianna.bis@gmail.com>2012-10-08 19:15:59 +0400
commitc78d571561b66e98e955bb5adb97fa5d542bdb1c (patch)
tree766445332279a866b3253ead06fc4c953bbbff6a /mert/PermutationScorer.cpp
parentf4471692ba51aeec3cf9867fcabe2c4fc7d4cb33 (diff)
fixed bug in permutation scores due to scientific notation
Diffstat (limited to 'mert/PermutationScorer.cpp')
-rw-r--r--mert/PermutationScorer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/PermutationScorer.cpp b/mert/PermutationScorer.cpp
index c6588eec7..12025a77e 100644
--- a/mert/PermutationScorer.cpp
+++ b/mert/PermutationScorer.cpp
@@ -225,12 +225,12 @@ void PermutationScorer::prepareStats(size_t sid, const string& text, ScoreStats&
//SCOREROUT eg: 0.04546
distanceValue*=SCORE_MULTFACT; //SCOREROUT eg: 4546 to transform float into integer
ostringstream tempStream;
- tempStream.precision(SCORE_PRECISION);
- tempStream << distanceValue << " 1"; //use for final normalization over the amount of test sentences
+ tempStream.precision(0); // decimal precision not needed as score was multiplied per SCORE_MULTFACT
+ tempStream << std::fixed << distanceValue << " 1"; //use for final normalization over the amount of test sentences
string str = tempStream.str();
entry.set(str);
- //cout << tempStream.str();
+//cout << distanceValue << "=" << distanceValue << " (str:" << tempStream.str() << ")" << endl;
}
//Will just be final score