diff options
author | Chris Dyer <cdyer@Chriss-MacBook-Air.local> | 2013-11-10 13:22:23 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@Chriss-MacBook-Air.local> | 2013-11-10 13:22:23 -0500 |
commit | 73a5e89074c7a531caee6faa72cfd9c22dafa43e (patch) | |
tree | e7795c4e710637af708f5d2212b991e2fac0c4aa /decoder | |
parent | 5ca9348b98a519015c4080186ea1a6fe42ef4a2b (diff) |
fix for mavericks
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/ff_context.cc | 2 | ||||
-rw-r--r-- | decoder/phrasebased_translator.cc | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/decoder/ff_context.cc b/decoder/ff_context.cc index f2b0e67c..e56f6f1f 100644 --- a/decoder/ff_context.cc +++ b/decoder/ff_context.cc @@ -46,7 +46,7 @@ void RuleContextFeatures::ReplaceMacroWithString( macro << relative_location << "]"; int macro_index = feature_instance.find(macro.str()); if (macro_index == string::npos) { - cerr << "Can't find macro " << macro << " in feature template " + cerr << "Can't find macro " << macro.str() << " in feature template " << feature_instance; abort(); } 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 << '['; |