-show-weights: output sparseProducerWeight if != 1, otherwise 'sparse'

This commit is contained in:
Eva Hasler 2011-12-13 19:13:13 +00:00
parent 76d7595667
commit 85ce6547fd
4 changed files with 15 additions and 5 deletions

View File

@ -175,8 +175,12 @@ static void PrintFeatureWeight(const FeatureFunction* ff)
<< values[i] << endl;
}
} else {
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " sparse" << endl;
if (ff->GetSparseProducerWeight() == 1)
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " sparse" << endl;
else
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " " << ff->GetSparseProducerWeight() << endl;
}
}

View File

@ -297,8 +297,12 @@ static void PrintFeatureWeight(const FeatureFunction* ff)
<< values[i] << endl;
}
} else {
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " sparse" << endl;
if (ff->GetSparseProducerWeight() == 1)
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " sparse" << endl;
else
cout << ff->GetScoreProducerDescription() << " " <<
ff->GetScoreProducerWeightShortName() << " " << ff->GetSparseProducerWeight() << endl;
}
}

View File

@ -54,6 +54,8 @@ public:
void SetSparseFeatureReporting() { m_reportSparseFeatures = true; }
bool GetSparseFeatureReporting() const { return m_reportSparseFeatures; }
virtual float GetSparseProducerWeight() const { return 1; }
};

View File

@ -209,7 +209,7 @@ public:
size_t GetNumInputScores() const;
void SetSparseProducerWeight(float weight) { m_sparseProducerWeight = weight; }
float GetSparseProducerWeight() { return m_sparseProducerWeight; }
float GetSparseProducerWeight() const { return m_sparseProducerWeight; }
virtual const FFState* EmptyHypothesisState(const InputType &input) const;