diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-27 20:50:52 +0400 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-27 20:50:52 +0400 |
commit | 291260abf74ed3fe0c9218465cff6e658d0a1b23 (patch) | |
tree | 474b29cf0ba2b37c5ed41b4c805a85121362a3a7 /mert/FeatureStats.cpp | |
parent | 89194be5ebb641072795d9e949312002ac6262e6 (diff) |
- made output more compliant with old version
- added PerSCorer.h and BleuScorer.h
- stored feature names
- fixed bug about output of best Point
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1796 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/FeatureStats.cpp')
-rw-r--r-- | mert/FeatureStats.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/mert/FeatureStats.cpp b/mert/FeatureStats.cpp index 54ea76295..95f3aa2e7 100644 --- a/mert/FeatureStats.cpp +++ b/mert/FeatureStats.cpp @@ -13,7 +13,7 @@ FeatureStats::FeatureStats() {}; - FeatureStats::FeatureStats(const FeatureStats &stats): +FeatureStats::FeatureStats(const FeatureStats &stats): array_(stats.array_) {}; @@ -31,7 +31,7 @@ FeatureStats::FeatureStats(std::string &theString) void FeatureStats::set(std::string &theString) { - std::string substring, stringBuf; + std::string substring, stringBuf; int nextPound; FeatureStatsType sc; @@ -45,7 +45,7 @@ void FeatureStats::set(std::string &theString) void FeatureStats::loadtxt(std::ifstream& inFile) { - std::string theString; + std::string theString; std::getline(inFile, theString); set(theString); } @@ -72,14 +72,7 @@ void FeatureStats::savetxt(const std::string &file) void FeatureStats::savetxt(std::ofstream& outFile) { - vector<FeatureStatsType>::iterator i = array_.begin(); - outFile << *i; - i++; - while (i !=array_.end()){ - outFile << " " << *i; - i++; - } -// outFile << std::endl; + outFile << *this; } @@ -91,3 +84,9 @@ FeatureStats& FeatureStats::operator=(const FeatureStats &stats) } +/**write the whole object to a stream*/ +ostream& operator<<(ostream& o, const FeatureStats& e){ + for (featstats_t::iterator i = e.getArray().begin(); i != e.getArray().end(); i++) + o << *i << " "; + return o; +} |