00001 // $Id$ 00002 00003 #include <iostream> 00004 #include <sstream> 00005 #include <algorithm> 00006 00007 #include "TranslationAnalysis.h" 00008 00009 #include "moses/StaticData.h" 00010 #include "moses/TranslationOption.h" 00011 #include "moses/DecodeStepTranslation.h" 00012 00013 using namespace std; 00014 using namespace Moses; 00015 00016 namespace TranslationAnalysis 00017 { 00018 00019 void PrintTranslationAnalysis(ostream & /* os */, const Hypothesis* /* hypo */) 00020 { 00021 /* 00022 os << endl << "TRANSLATION HYPOTHESIS DETAILS:" << endl; 00023 queue<const Hypothesis*> translationPath; 00024 while (hypo) 00025 { 00026 translationPath.push(hypo); 00027 hypo = hypo->GetPrevHypo(); 00028 } 00029 00030 while (!translationPath.empty()) 00031 { 00032 hypo = translationPath.front(); 00033 translationPath.pop(); 00034 const TranslationOption *transOpt = hypo->GetTranslationOption(); 00035 if (transOpt != NULL) 00036 { 00037 os << hypo->GetCurrSourceWordsRange() << " "; 00038 for (size_t decodeStepId = 0; decodeStepId < DecodeStepTranslation::GetNumTransStep(); ++decodeStepId) 00039 os << decodeStepId << "=" << transOpt->GetSubRangeCount(decodeStepId) << ","; 00040 os << *transOpt << endl; 00041 } 00042 } 00043 00044 os << "END TRANSLATION" << endl; 00045 */ 00046 } 00047 00048 } 00049