diff --git a/moses/RuleCube.h b/moses/RuleCube.h index 78c77fd07..58707218f 100644 --- a/moses/RuleCube.h +++ b/moses/RuleCube.h @@ -57,8 +57,13 @@ class RuleCubeItemHasher public: size_t operator()(const RuleCubeItem *p) const { size_t seed = 0; - boost::hash_combine(seed, p->GetHypothesisDimensions()); - boost::hash_combine(seed, p->GetTranslationDimension().GetTranslationOption().get()); + const std::vector &hypoDim = p->GetHypothesisDimensions(); + const ChartTranslationOption *transOpt = p->GetTranslationDimension().GetTranslationOption().get(); + + boost::hash_combine(seed, hypoDim); + boost::hash_combine(seed, transOpt); + + std::cerr << seed << " "; return seed; } }; @@ -69,8 +74,9 @@ class RuleCubeItemEqualityPred { public: bool operator()(const RuleCubeItem *p, const RuleCubeItem *q) const { - return p->GetHypothesisDimensions() == q->GetHypothesisDimensions() && - p->GetTranslationDimension() == q->GetTranslationDimension(); + bool ret = p->GetHypothesisDimensions() == q->GetHypothesisDimensions() && + p->GetTranslationDimension() == q->GetTranslationDimension(); + return ret; } }; diff --git a/moses/RuleCubeItem.h b/moses/RuleCubeItem.h index 3e687d194..bcb0f8d42 100644 --- a/moses/RuleCubeItem.h +++ b/moses/RuleCubeItem.h @@ -58,11 +58,11 @@ public: } bool operator<(const TranslationDimension &compare) const { - return GetTranslationOption()->GetPhrase() < compare.GetTranslationOption()->GetPhrase(); + return GetTranslationOption().get() < compare.GetTranslationOption().get(); } bool operator==(const TranslationDimension &compare) const { - return GetTranslationOption()->GetPhrase() == compare.GetTranslationOption()->GetPhrase(); + return GetTranslationOption().get() == compare.GetTranslationOption().get(); } private: diff --git a/moses/TargetPhrase.h b/moses/TargetPhrase.h index 476d32910..7b0cfbc2a 100644 --- a/moses/TargetPhrase.h +++ b/moses/TargetPhrase.h @@ -140,6 +140,9 @@ public: void Merge(const TargetPhrase ©, const std::vector& factorVec); + bool operator< (const TargetPhrase &compare) const; // NOT IMPLEMENTED + bool operator== (const TargetPhrase &compare) const; // NOT IMPLEMENTED + TO_STRING(); };