diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2014-08-11 14:49:38 +0400 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2014-08-11 14:49:38 +0400 |
commit | 27eee55a57d08b2f2cd30cd28aa8ab5e1145cfec (patch) | |
tree | aecacd65653133474b42b4eaeea3b48bf78a9d4c /moses/ScoreComponentCollection.h | |
parent | c5b3f67877cb70a64243d9f78d4656c1244de1e9 (diff) | |
parent | 79b6b602374186d310095aea13a2f392bc1d5927 (diff) |
Merge branch 'master' of github.com:moses-smt/mosesdecoder
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r-- | moses/ScoreComponentCollection.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h index 858fcd5a8..b44216d29 100644 --- a/moses/ScoreComponentCollection.h +++ b/moses/ScoreComponentCollection.h @@ -261,6 +261,11 @@ public: void PlusEquals(const FeatureFunction* sp, const ScorePair &scorePair); + // Add score by index + void PlusEquals(size_t index, float score) { + m_scores[index] += score; + } + //For features which have an unbounded number of components void SparsePlusEquals(const std::string& full_name, float score) { FName fname(full_name); @@ -283,7 +288,7 @@ public: m_scores[indexes.first] = score; } - // Assign core weight by index + // Assign score by index void Assign(size_t index, float score) { m_scores[index] = score; } @@ -354,6 +359,11 @@ public: m_scores.capMin(minValue); } + std::pair<size_t,size_t> GetIndexesForProducer(const FeatureFunction* sp) const { + IndexPair indexPair = GetIndexes(sp); + return indexPair; + } + //! if a FeatureFunction produces a single score (for example, a language model score) //! this will return it. If not, this method will throw float GetScoreForProducer(const FeatureFunction* sp) const { |