diff options
Diffstat (limited to 'decoder/phrasebased_translator.cc')
-rw-r--r-- | decoder/phrasebased_translator.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/decoder/phrasebased_translator.cc b/decoder/phrasebased_translator.cc index 04b3e5d2..8048248e 100644 --- a/decoder/phrasebased_translator.cc +++ b/decoder/phrasebased_translator.cc @@ -54,10 +54,13 @@ struct Coverage : public vector<bool> { }; struct CoverageHash { size_t operator()(const Coverage& cov) const { - return hasher_(static_cast<const vector<bool>&>(cov)); + int seed = 131; + size_t res = 0; + for (vector<bool>::const_iterator it = cov.begin(); it != cov.end(); ++it) { + res = (res * seed) + (*it + 1); + } + return res; } - private: - boost::hash<vector<bool> > hasher_; }; ostream& operator<<(ostream& os, const Coverage& cov) { os << '['; |