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:
authorBarry Haddow <barry.haddow@gmail.com>2011-11-17 19:58:56 +0400
committerBarry Haddow <barry.haddow@gmail.com>2011-11-17 19:58:56 +0400
commitba5633c7b57b8843f9befc836db78989f3d15652 (patch)
tree4342cdcbf03d6d0ae6e42a519ebb1a67ebee8746 /mert/ScoreArray.cpp
parent71c777f01df14c9523e20f118c90396d51678c02 (diff)
parent492fe6d97af84065fa0b4e0afa9b77a26761a11f (diff)
Merge remote branch 'origin/master' into pro
Conflicts: kenlm mert/Data.cpp mert/Data.h mert/Makefile.am mert/mert.cpp
Diffstat (limited to 'mert/ScoreArray.cpp')
-rw-r--r--mert/ScoreArray.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/mert/ScoreArray.cpp b/mert/ScoreArray.cpp
index 92824c818..b26b93114 100644
--- a/mert/ScoreArray.cpp
+++ b/mert/ScoreArray.cpp
@@ -6,12 +6,13 @@
*
*/
-#include <fstream>
#include "ScoreArray.h"
#include "Util.h"
+#include "FileStream.h"
-ScoreArray::ScoreArray(): idx("")
-{};
+
+ScoreArray::ScoreArray()
+ : number_of_scores(0), idx("") {}
void ScoreArray::savetxt(std::ofstream& outFile, const std::string& sctype)
{
@@ -132,17 +133,15 @@ void ScoreArray::merge(ScoreArray& e)
add(e.get(i));
}
-bool ScoreArray::check_consistency()
+bool ScoreArray::check_consistency() const
{
- size_t sz = NumberOfScores();
-
+ const size_t sz = NumberOfScores();
if (sz == 0)
return true;
- for (scorearray_t::iterator i=array_.begin(); i!=array_.end(); i++)
- if (i->size()!=sz)
+ for (scorearray_t::const_iterator i = array_.begin(); i != array_.end(); ++i) {
+ if (i->size() != sz)
return false;
+ }
return true;
}
-
-