diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-08 19:02:59 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-08 19:02:59 +0400 |
commit | 42fc86b259498d99d75e4fd956e74ecd8888440a (patch) | |
tree | dc288a420e68d05f03b495ccf282c4f80feeb96c /moses/ScoreComponentCollection.cpp | |
parent | 7214be82d45dbb2f113e3f0aec25b25d9cd76632 (diff) |
lattice decoding with sparse features
Diffstat (limited to 'moses/ScoreComponentCollection.cpp')
-rw-r--r-- | moses/ScoreComponentCollection.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/moses/ScoreComponentCollection.cpp b/moses/ScoreComponentCollection.cpp index d3c31d625..7cd9be701 100644 --- a/moses/ScoreComponentCollection.cpp +++ b/moses/ScoreComponentCollection.cpp @@ -11,15 +11,15 @@ namespace Moses void ScorePair::PlusEquals(const ScorePair &other) { PlusEquals(other.denseScores); - std::map<std::string, float>::const_iterator iter; + std::map<StringPiece, float>::const_iterator iter; for (iter = other.sparseScores.begin(); iter != other.sparseScores.end(); ++iter) { PlusEquals(iter->first, iter->second); } } -void ScorePair::PlusEquals(const std::string &key, float value) +void ScorePair::PlusEquals(const StringPiece &key, float value) { - std::map<std::string, float>::iterator iter; + std::map<StringPiece, float>::iterator iter; iter = sparseScores.find(key); if (iter == sparseScores.end()) { sparseScores[key] = value; @@ -245,9 +245,9 @@ void ScoreComponentCollection::PlusEquals(const FeatureFunction* sp, const Score { PlusEquals(sp, scorePair.denseScores); - std::map<std::string, float>::const_iterator iter; + std::map<StringPiece, float>::const_iterator iter; for (iter = scorePair.sparseScores.begin(); iter != scorePair.sparseScores.end(); ++iter) { - const string &key = iter->first; + const StringPiece &key = iter->first; float value = iter->second; PlusEquals(sp, key, value); } |