diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-05-02 13:45:24 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-05-02 13:45:24 +0300 |
commit | cc8c6b7b10abd8118014635609f7658f6a7a1857 (patch) | |
tree | cab374bcbf73ff97782e9131380e4f32dbeb1e67 /moses/ScoreComponentCollection.cpp | |
parent | a4a7c14593766ab188e1d6ae1c29e67ed201d412 (diff) |
beautify
Diffstat (limited to 'moses/ScoreComponentCollection.cpp')
-rw-r--r-- | moses/ScoreComponentCollection.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/moses/ScoreComponentCollection.cpp b/moses/ScoreComponentCollection.cpp index d07fb5f00..31de139ea 100644 --- a/moses/ScoreComponentCollection.cpp +++ b/moses/ScoreComponentCollection.cpp @@ -67,7 +67,7 @@ RegisterScoreProducer(FeatureFunction* scoreProducer) VERBOSE(1, "FeatureFunction: " << scoreProducer->GetScoreProducerDescription() << " start: " << start - << " end: " << (s_denseVectorSize-1) << endl); + << " end: " << (s_denseVectorSize-1) << endl); } @@ -194,21 +194,19 @@ void ScoreComponentCollection::Save(ostream& out, bool multiline) const } std::vector<FeatureFunction*> const& all_ff - = FeatureFunction::GetFeatureFunctions(); - BOOST_FOREACH(FeatureFunction const* ff, all_ff) - { - string name = ff->GetScoreProducerDescription(); - size_t i = ff->GetIndex(); - if (ff->GetNumScoreComponents() == 1) - out << name << sep << m_scores[i] << linesep; - else - { - size_t stop = i + ff->GetNumScoreComponents(); - boost::format fmt("%s_%d"); - for (size_t k = 1; i < stop; ++i, ++k) - out << fmt % name % k << sep << m_scores[i] << linesep; - } + = FeatureFunction::GetFeatureFunctions(); + BOOST_FOREACH(FeatureFunction const* ff, all_ff) { + string name = ff->GetScoreProducerDescription(); + size_t i = ff->GetIndex(); + if (ff->GetNumScoreComponents() == 1) + out << name << sep << m_scores[i] << linesep; + else { + size_t stop = i + ff->GetNumScoreComponents(); + boost::format fmt("%s_%d"); + for (size_t k = 1; i < stop; ++i, ++k) + out << fmt % name % k << sep << m_scores[i] << linesep; } + } // write sparse features m_scores.write(out,sep,linesep); } |