From 1adf7d05214526e98e8c6c31b090fbd3b485e4d4 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Sun, 8 Sep 2013 15:57:31 +0200 Subject: lattice decoding with sparse features --- moses/ScoreComponentCollection.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'moses/ScoreComponentCollection.cpp') 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::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); + } +} + } -- cgit v1.2.3