Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r--moses/ScoreComponentCollection.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h
index 1305e9c16..0ab57a73a 100644
--- a/moses/ScoreComponentCollection.h
+++ b/moses/ScoreComponentCollection.h
@@ -247,6 +247,15 @@ public:
}
}
+ void PlusEquals(const FeatureFunction* sp, float scores[])
+ {
+ size_t numScores = sp->GetNumScoreComponents();
+ size_t offset = sp->GetIndex();
+ for (size_t i = 0; i < numScores; ++i) {
+ m_scores[i + offset] += scores[i];
+ }
+ }
+
//! Special version PlusEquals(ScoreProducer, vector<float>)
//! to add the score from a single ScoreProducer that produces
//! a single value