diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-04-03 19:54:46 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-04-03 19:54:46 +0400 |
commit | 0953b5cacaf9a99c324f6a381e384b5708f6b5d2 (patch) | |
tree | ed9ba1c62c5fe77d18b60a934f0b638b95f237b0 /moses/SearchNormal.cpp | |
parent | ccdd628d25782b6318e539702c3f80c536fd37be (diff) |
debugging
Diffstat (limited to 'moses/SearchNormal.cpp')
-rw-r--r-- | moses/SearchNormal.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/moses/SearchNormal.cpp b/moses/SearchNormal.cpp index 596ede562..37a23b60c 100644 --- a/moses/SearchNormal.cpp +++ b/moses/SearchNormal.cpp @@ -57,6 +57,7 @@ void SearchNormal::ProcessSentence() m_hypoStackColl[0]->AddPrune(hypo); // go through each stack + size_t stackNo = 0; std::vector < HypothesisStack* >::iterator iterStack; for (iterStack = m_hypoStackColl.begin() ; iterStack != m_hypoStackColl.end() ; ++iterStack) { // check if decoding ran out of time @@ -90,9 +91,12 @@ void SearchNormal::ProcessSentence() IFVERBOSE(2) { OutputHypoStackSize(); } + OutputHypoStack(stackNo); // this stack is fully expanded; actual_hypoStack = &sourceHypoColl; + + ++stackNo; } } @@ -381,4 +385,19 @@ void SearchNormal::OutputHypoStackSize() TRACE_ERR( endl); } +void SearchNormal::OutputHypoStack(int stack) +{ + if (stack >= 0) { + TRACE_ERR( "Stack " << stack << ": " << endl << m_hypoStackColl[stack] << endl); + } else { + // all stacks + int i = 0; + vector < HypothesisStack* >::iterator iterStack; + for (iterStack = m_hypoStackColl.begin() ; iterStack != m_hypoStackColl.end() ; ++iterStack) { + HypothesisStackNormal &hypoColl = *static_cast<HypothesisStackNormal*>(*iterStack); + TRACE_ERR( "Stack " << i++ << ": " << endl << hypoColl << endl); + } + } +} + } |