From 73a5e89074c7a531caee6faa72cfd9c22dafa43e Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 10 Nov 2013 13:22:23 -0500 Subject: fix for mavericks --- decoder/ff_context.cc | 2 +- decoder/phrasebased_translator.cc | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'decoder') 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 { }; struct CoverageHash { size_t operator()(const Coverage& cov) const { - return hasher_(static_cast&>(cov)); + int seed = 131; + size_t res = 0; + for (vector::const_iterator it = cov.begin(); it != cov.end(); ++it) { + res = (res * seed) + (*it + 1); + } + return res; } - private: - boost::hash > hasher_; }; ostream& operator<<(ostream& os, const Coverage& cov) { os << '['; -- cgit v1.2.3