diff options
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r-- | moses/ScoreComponentCollection.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h index c5f5ed531..62720512c 100644 --- a/moses/ScoreComponentCollection.h +++ b/moses/ScoreComponentCollection.h @@ -247,6 +247,14 @@ 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 |