mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +03:00
compare translation option dimension using pointers to translation option, rather than comparing the phrase. Comparinf the phrase is incorrect - need to compare LHS and possibly alignments too. Unnecessary
This commit is contained in:
parent
3bd5583976
commit
ff3c8c195a
@ -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<HypothesisDimension> &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;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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:
|
||||
|
@ -140,6 +140,9 @@ public:
|
||||
|
||||
void Merge(const TargetPhrase ©, const std::vector<FactorType>& factorVec);
|
||||
|
||||
bool operator< (const TargetPhrase &compare) const; // NOT IMPLEMENTED
|
||||
bool operator== (const TargetPhrase &compare) const; // NOT IMPLEMENTED
|
||||
|
||||
TO_STRING();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user