mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
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
This commit is contained in:
parent
47e452a076
commit
23d9a9b55e
@ -340,7 +340,7 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha
|
||||
// print the surface factor of the translation
|
||||
out << translationId << " ||| ";
|
||||
OutputSurface(out, outputPhrase, m_outputFactorOrder, false);
|
||||
out << " ||| ";
|
||||
out << " |||";
|
||||
|
||||
// print the scores in a hardwired order
|
||||
// before each model type, the corresponding command-line-like name must be emitted
|
||||
@ -350,10 +350,10 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha
|
||||
const LMList& lml = system->GetLanguageModels();
|
||||
if (lml.size() > 0) {
|
||||
if (labeledOutput)
|
||||
out << "lm: ";
|
||||
out << "lm:";
|
||||
LMList::const_iterator lmi = lml.begin();
|
||||
for (; lmi != lml.end(); ++lmi) {
|
||||
out << path.GetScoreBreakdown().GetScoreForProducer(*lmi) << " ";
|
||||
out << " " << path.GetScoreBreakdown().GetScoreForProducer(*lmi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,8 +382,8 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha
|
||||
|
||||
// word penalty
|
||||
if (labeledOutput)
|
||||
out << " w: ";
|
||||
out << path.GetScoreBreakdown().GetScoreForProducer(system->GetWordPenaltyProducer()) << " ";
|
||||
out << " w:";
|
||||
out << " " << path.GetScoreBreakdown().GetScoreForProducer(system->GetWordPenaltyProducer());
|
||||
|
||||
// generation
|
||||
const vector<GenerationDictionary*>& gds = system->GetGenerationDictionaries();
|
||||
@ -407,7 +407,7 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha
|
||||
|
||||
|
||||
// total
|
||||
out << "||| " << path.GetTotalScore();
|
||||
out << " |||" << path.GetTotalScore();
|
||||
|
||||
/*
|
||||
if (includeAlignment) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user