summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ff_context.cc2
-rw-r--r--decoder/phrasebased_translator.cc9
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 << '[';