Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Haddow <barry.haddow@gmail.com>2012-01-20 19:35:55 +0400
committerBarry Haddow <barry.haddow@gmail.com>2012-01-20 19:35:55 +0400
commit1e10bb7ef7081ddc76463c90ff5d58820b91a39e (patch)
tree997282fa010af6fb35d6ddea2d6ef88b2ebbb90e /moses-cmd
parentced24a881d8cb9092aad4f620f403a34f308dae1 (diff)
Merge from miramerge.
Reverted ChartHypothesis as it breaks chart-decoding.
Diffstat (limited to 'moses-cmd')
-rw-r--r--moses-cmd/src/Main.cpp21
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 **/