From ac52c6062f4fa2c4194e21ac46ee21aeeeb56ae4 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 16 Dec 2015 16:53:00 +0000 Subject: [PATCH] output ff name for debugging --- contrib/other-builds/moses2/FF/FeatureFunctions.h | 3 +++ contrib/other-builds/moses2/Scores.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/contrib/other-builds/moses2/FF/FeatureFunctions.h b/contrib/other-builds/moses2/FF/FeatureFunctions.h index 5f92d9aa3..f3231dd51 100644 --- a/contrib/other-builds/moses2/FF/FeatureFunctions.h +++ b/contrib/other-builds/moses2/FF/FeatureFunctions.h @@ -32,6 +32,9 @@ public: FeatureFunctions(System &system); virtual ~FeatureFunctions(); + const std::vector &GetFeatureFunctions() const + { return m_featureFunctions; } + const std::vector &GetStatefulFeatureFunctions() const { return m_statefulFeatureFunctions; } diff --git a/contrib/other-builds/moses2/Scores.cpp b/contrib/other-builds/moses2/Scores.cpp index cb0cf8967..f89d991c5 100644 --- a/contrib/other-builds/moses2/Scores.cpp +++ b/contrib/other-builds/moses2/Scores.cpp @@ -5,6 +5,7 @@ * Author: hieu */ +#include #include #include #include @@ -210,6 +211,14 @@ void Scores::Debug(std::ostream &out, const FeatureFunctions &ffs) const { out << m_total << " = "; if (m_scores) { + BOOST_FOREACH(const FeatureFunction *ff, ffs.GetFeatureFunctions()) { + out << ff->GetName() << ":"; + for (size_t i = ff->GetStartInd(); i < (ff->GetStartInd() + ff->GetNumScores()); ++i) { + out << m_scores[i] << " "; + } + + } + size_t numScores = ffs.GetNumScores(); for (size_t i = 0; i < numScores; ++i) { out << m_scores[i] << " ";