diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2012-01-20 19:35:55 +0400 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2012-01-20 19:35:55 +0400 |
commit | 1e10bb7ef7081ddc76463c90ff5d58820b91a39e (patch) | |
tree | 997282fa010af6fb35d6ddea2d6ef88b2ebbb90e /moses-cmd | |
parent | ced24a881d8cb9092aad4f620f403a34f308dae1 (diff) |
Merge from miramerge.
Reverted ChartHypothesis as it breaks chart-decoding.
Diffstat (limited to 'moses-cmd')
-rw-r--r-- | moses-cmd/src/Main.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/moses-cmd/src/Main.cpp b/moses-cmd/src/Main.cpp index 0eccac246..feb092dab 100644 --- a/moses-cmd/src/Main.cpp +++ b/moses-cmd/src/Main.cpp @@ -287,21 +287,27 @@ private: static void PrintFeatureWeight(const FeatureFunction* ff) { - size_t numScoreComps = ff->GetNumScoreComponents(); if (numScoreComps != ScoreProducer::unlimited) { vector<float> values = StaticData::Instance().GetAllWeights().GetScoresForProducer(ff); - for (size_t i = 0; i < numScoreComps; ++i) { + for (size_t i = 0; i < numScoreComps; ++i) cout << ff->GetScoreProducerDescription() << " " << ff->GetScoreProducerWeightShortName() << " " << values[i] << endl; - } - } else { - cout << ff->GetScoreProducerDescription() << " " << - ff->GetScoreProducerWeightShortName() << " sparse" << endl; } } +static void PrintSparseFeatureWeight(const FeatureFunction* ff) +{ + if (ff->GetNumScoreComponents() == ScoreProducer::unlimited) { + if (ff->GetSparseProducerWeight() == 1) + cout << ff->GetScoreProducerDescription() << " " << + ff->GetScoreProducerWeightShortName() << " sparse" << endl; + else + cout << ff->GetScoreProducerDescription() << " " << + ff->GetScoreProducerWeightShortName() << " " << ff->GetSparseProducerWeight() << endl; + } +} static void ShowWeights() { @@ -324,6 +330,9 @@ static void ShowWeights() for (size_t i = 0; i < gds.size(); ++i) { PrintFeatureWeight(gds[i]); } + for (size_t i = 0; i < sff.size(); ++i) { + PrintSparseFeatureWeight(sff[i]); + } } /** main function of the command line version of the decoder **/ |