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:
authorBarry Haddow <barry.haddow@gmail.com>2014-08-11 14:49:38 +0400
committerBarry Haddow <barry.haddow@gmail.com>2014-08-11 14:49:38 +0400
commit27eee55a57d08b2f2cd30cd28aa8ab5e1145cfec (patch)
treeaecacd65653133474b42b4eaeea3b48bf78a9d4c /moses/ScoreComponentCollection.h
parentc5b3f67877cb70a64243d9f78d4656c1244de1e9 (diff)
parent79b6b602374186d310095aea13a2f392bc1d5927 (diff)
Merge branch 'master' of github.com:moses-smt/mosesdecoder
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r--moses/ScoreComponentCollection.h12
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 {