diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-30 16:23:30 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-30 16:23:30 +0300 |
commit | ba166f109cc1bda482e32ba490905d769dc1b9ae (patch) | |
tree | 07741cdfbdb178f2dace9cdfba125c369d0cba55 /moses/BaseManager.cpp | |
parent | 14cbf9bc2263485a5bef03fd61632a3fda41af6c (diff) |
moving more stuff out of IOWrapper
Diffstat (limited to 'moses/BaseManager.cpp')
-rw-r--r-- | moses/BaseManager.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/moses/BaseManager.cpp b/moses/BaseManager.cpp index e41685344..f79842311 100644 --- a/moses/BaseManager.cpp +++ b/moses/BaseManager.cpp @@ -9,54 +9,6 @@ using namespace std; namespace Moses { -void BaseManager::OutputAllFeatureScores(const Moses::ScoreComponentCollection &features, - std::ostream &out) const -{ - std::string lastName = ""; - const vector<const StatefulFeatureFunction*>& sff = StatefulFeatureFunction::GetStatefulFeatureFunctions(); - for( size_t i=0; i<sff.size(); i++ ) { - const StatefulFeatureFunction *ff = sff[i]; - if (ff->GetScoreProducerDescription() != "BleuScoreFeature" - && ff->IsTuneable()) { - OutputFeatureScores( out, features, ff, lastName ); - } - } - const vector<const StatelessFeatureFunction*>& slf = StatelessFeatureFunction::GetStatelessFeatureFunctions(); - for( size_t i=0; i<slf.size(); i++ ) { - const StatelessFeatureFunction *ff = slf[i]; - if (ff->IsTuneable()) { - OutputFeatureScores( out, features, ff, lastName ); - } - } -} - -void BaseManager::OutputFeatureScores( std::ostream& out, - const ScoreComponentCollection &features, - const FeatureFunction *ff, - std::string &lastName ) const -{ - const StaticData &staticData = StaticData::Instance(); - bool labeledOutput = staticData.IsLabeledNBestList(); - - // regular features (not sparse) - if (ff->GetNumScoreComponents() != 0) { - if( labeledOutput && lastName != ff->GetScoreProducerDescription() ) { - lastName = ff->GetScoreProducerDescription(); - out << " " << lastName << "="; - } - vector<float> scores = features.GetScoresForProducer( ff ); - for (size_t j = 0; j<scores.size(); ++j) { - out << " " << scores[j]; - } - } - - // sparse features - const FVector scores = features.GetVectorForProducer( ff ); - for(FVector::FNVmap::const_iterator i = scores.cbegin(); i != scores.cend(); i++) { - out << " " << i->first << "= " << i->second; - } -} - /*** * print surface factor only for the given phrase */ |