diff --git a/contrib/moses2/ArcLists.cpp b/contrib/moses2/ArcLists.cpp index 36e86b433..edc985465 100644 --- a/contrib/moses2/ArcLists.cpp +++ b/contrib/moses2/ArcLists.cpp @@ -5,6 +5,7 @@ * Author: hieu */ #include +#include #include #include #include "ArcLists.h" @@ -114,5 +115,15 @@ void ArcLists::Delete(const HypothesisBase *hypo) delete arcList; } +std::string ArcLists::Debug(const System &system) const +{ + stringstream strm; + BOOST_FOREACH(const Coll::value_type &collPair, m_coll){ + const ArcList *arcList = collPair.second; + strm << arcList << "(" << arcList->size() << ") "; + } + return strm.str(); +} + } diff --git a/contrib/moses2/ArcLists.h b/contrib/moses2/ArcLists.h index 2a73554e1..db606401f 100644 --- a/contrib/moses2/ArcLists.h +++ b/contrib/moses2/ArcLists.h @@ -10,6 +10,7 @@ namespace Moses2 { +class System; class HypothesisBase; @@ -28,6 +29,7 @@ public: const ArcList &GetArcList(const HypothesisBase *hypo) const; + std::string Debug(const System &system) const; protected: typedef boost::unordered_map Coll; Coll m_coll; diff --git a/contrib/moses2/SCFG/KBestExtractor.cpp b/contrib/moses2/SCFG/KBestExtractor.cpp index f6ebf2689..f5d46cc30 100644 --- a/contrib/moses2/SCFG/KBestExtractor.cpp +++ b/contrib/moses2/SCFG/KBestExtractor.cpp @@ -288,6 +288,8 @@ KBestExtractor::KBestExtractor(const SCFG::Manager &mgr) break; } + cerr << "RANGE=" << startPos << " " << phraseSize << endl; + const Stack &stack = stacks.GetStack(startPos, phraseSize); const Stack::Coll &allHypoColl = stack.GetColl(); BOOST_FOREACH(const Stack::Coll::value_type &valPair, allHypoColl) { diff --git a/contrib/moses2/SCFG/Manager.cpp b/contrib/moses2/SCFG/Manager.cpp index 8d12192a0..aeb483aef 100644 --- a/contrib/moses2/SCFG/Manager.cpp +++ b/contrib/moses2/SCFG/Manager.cpp @@ -387,6 +387,7 @@ std::string Manager::OutputNBest() //Moses2::FixPrecision(out); arcLists.Sort(); + //cerr << "arcs=" << arcLists.Debug(system) << endl; KBestExtractor extractor(*this); extractor.OutputToStream(out);