diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-08 17:57:31 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-08 17:57:31 +0400 |
commit | 1adf7d05214526e98e8c6c31b090fbd3b485e4d4 (patch) | |
tree | b04f4a3ce9d8a8e5a3a8e039cc8bd24dcfb39297 /moses/ScoreComponentCollection.cpp | |
parent | 65e2806b1d5f39ee800606ca89f37ce2778533d4 (diff) |
lattice decoding with sparse features
Diffstat (limited to 'moses/ScoreComponentCollection.cpp')
-rw-r--r-- | moses/ScoreComponentCollection.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.cpp b/moses/ScoreComponentCollection.cpp index 97ae2684d..c9b4d1ea0 100644 --- a/moses/ScoreComponentCollection.cpp +++ b/moses/ScoreComponentCollection.cpp @@ -220,6 +220,18 @@ FVector ScoreComponentCollection::GetVectorForProducer(const FeatureFunction* sp return fv; } +void ScoreComponentCollection::PlusEquals(const FeatureFunction* sp, const ScorePair &scorePair) +{ + PlusEquals(sp, scorePair.denseScores); + + std::map<std::string, float>::const_iterator iter; + for (iter = scorePair.sparseScores.begin(); iter != scorePair.sparseScores.end(); ++iter) { + const string &key = iter->first; + float value = iter->second; + PlusEquals(sp, key, value); + } +} + } |