diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-21 20:35:36 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-21 20:35:36 +0400 |
commit | 8fcc3451fa0b0c7b8006f65df8d3690ff8cc1df8 (patch) | |
tree | ff6a50862c176d05591f4c01e0922916e9b0af89 /moses | |
parent | e6ae8ceee5e09ac62ebdb2a98937bc56e7747c82 (diff) |
merge
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@244 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/ScoreColl.cpp | 16 | ||||
-rw-r--r-- | moses/src/ScoreColl.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/moses/src/ScoreColl.cpp b/moses/src/ScoreColl.cpp new file mode 100644 index 000000000..e010066a5 --- /dev/null +++ b/moses/src/ScoreColl.cpp @@ -0,0 +1,16 @@ + +#include "ScoreColl.h" + +void ScoreColl::Combine(const ScoreColl &other) +{ + const_iterator iter; + for (iter = other.begin() ; iter != other.end() ; iter++) + { + float value = iter->second; + iterator iterThis = find(iter->first); + assert (iterThis != end()); + + // score component for dictionary exists. add numbers + iterThis->second += value; + } +} diff --git a/moses/src/ScoreColl.h b/moses/src/ScoreColl.h index 39ced76ed..b3259fdfd 100644 --- a/moses/src/ScoreColl.h +++ b/moses/src/ScoreColl.h @@ -34,6 +34,7 @@ public: assert(iter != end()); return iter->second; } + void Combine(const ScoreColl &other); }; |