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 | 10992003895a0c89e00033c8e20fdebb90ea8f77 (patch) | |
tree | 5d97061ef67d9dcf8d72d3d85147be85abe3ef27 /decoder | |
parent | 43571516d8ba27599bd8ed58944d06715ea8533d (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 << '['; |