diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-03 20:11:39 +0400 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-03 20:11:39 +0400 |
commit | 23d9a9b55e620fc826cc53ba4fa648f2e2a65c3c (patch) | |
tree | ab54fc32500873b8e1110edd05a21a5c62e434a3 /moses-cmd | |
parent | 47e452a076b3112561bb68127aee7a68467ed1ed (diff) |
normalization of output spaces before and after field separator
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4293 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses-cmd')
-rwxr-xr-x | moses-cmd/src/IOWrapper.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/moses-cmd/src/IOWrapper.cpp b/moses-cmd/src/IOWrapper.cpp index 85276dd81..b3ae5fafe 100755 --- a/moses-cmd/src/IOWrapper.cpp +++ b/moses-cmd/src/IOWrapper.cpp @@ -311,8 +311,8 @@ void OutputBestHypo(const std::vector<Word>& mbrBestHypo, long /*translationId* for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) { const Factor *factor = mbrBestHypo[i].GetFactor(StaticData::Instance().GetOutputFactorOrder()[0]); - if (i>0) out << " "; - out << *factor; + if (i>0) out << " " << *factor; + else out << *factor; } out << endl; } @@ -499,22 +499,21 @@ void OutputLatticeMBRNBest(std::ostream& out, const vector<LatticeMBRSolution>& { for (vector<LatticeMBRSolution>::const_iterator si = solutions.begin(); si != solutions.end(); ++si) { out << translationId; - out << " ||| "; + out << " |||"; const vector<Word> mbrHypo = si->GetWords(); for (size_t i = 0 ; i < mbrHypo.size() ; i++) { const Factor *factor = mbrHypo[i].GetFactor(StaticData::Instance().GetOutputFactorOrder()[0]); - if (i>0) out << " "; - out << *factor; + if (i>0) out << " " << *factor; + else out << *factor; } - out << " ||| "; - out << "map: " << si->GetMapScore(); + out << " |||"; + out << " map: " << si->GetMapScore(); out << " w: " << mbrHypo.size(); const vector<float>& ngramScores = si->GetNgramScores(); for (size_t i = 0; i < ngramScores.size(); ++i) { out << " " << ngramScores[i]; } - out << " ||| "; - out << si->GetScore(); + out << " ||| " << si->GetScore(); out << endl; } |