diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-10-05 18:22:00 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-10-05 18:22:00 +0400 |
commit | d9e67b804be0a5c6af484252077fd4e4ca28438a (patch) | |
tree | a2068e813e166b1bf86a782c2ccb77dd4dd1c862 /moses | |
parent | 64305754d2ff8b1a7e58b19bd5e14f6c137b6fea (diff) |
verbose info submitted by Lexi Birch
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@860 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rwxr-xr-x | moses/src/Manager.cpp | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/moses/src/Manager.cpp b/moses/src/Manager.cpp index 53c607150..a1c8e4d16 100755 --- a/moses/src/Manager.cpp +++ b/moses/src/Manager.cpp @@ -352,12 +352,39 @@ void Manager::CalcNBest(size_t count, LatticePathList &ret,bool onlyDistinct) co } } -void Manager::CalcDecoderStatistics(const StaticData& staticData) const +void Manager::CalcDecoderStatistics(const StaticData& staticData) const { - const Hypothesis *hypo = GetBestHypothesis(); + const Hypothesis *hypo = GetBestHypothesis(); if (hypo != NULL) - staticData.GetSentenceStats().CalcFinalStats(*hypo); - else - { - } + { + staticData.GetSentenceStats().CalcFinalStats(*hypo); + IFVERBOSE(2) { + if (hypo != NULL) { + string buff; + string buff2; + TRACE_ERR ("Source and Target Units:"); + TRACE_ERR ((hypo->GetSourcePhrase()).ToString()); + buff2.insert(0,"] "); + buff2.insert(0,(hypo->GetTargetPhrase()).ToString()); + buff2.insert(0,":"); + buff2.insert(0,(hypo->GetCurrSourceWordsRange()).ToString()); + buff2.insert(0,"["); + + hypo = hypo->GetPrevHypo(); + while (hypo != NULL) { + //dont print out the empty final hypo + buff.insert(0,buff2); + buff2.clear(); + buff2.insert(0,"] "); + buff2.insert(0,(hypo->GetTargetPhrase()).ToString()); + buff2.insert(0,":"); + buff2.insert(0,(hypo->GetCurrSourceWordsRange()).ToString()); + buff2.insert(0,"["); + hypo = hypo->GetPrevHypo(); + } + TRACE_ERR (buff); + TRACE_ERR ("\n"); + } + } + } } |