diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-13 00:16:39 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-13 00:16:39 +0300 |
commit | ab025825c4569850cb2f080b3e9ce2ac821b8e5c (patch) | |
tree | a1ef232db74c9eb26ee0406b471d2b6c9583b589 /moses/Hypothesis.cpp | |
parent | 20959b866045163ed3178f71b2d87a62462ec343 (diff) |
recombination dependent on coverage bitmap
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r-- | moses/Hypothesis.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp index 41da95756..c2c27ac92 100644 --- a/moses/Hypothesis.cpp +++ b/moses/Hypothesis.cpp @@ -620,7 +620,12 @@ GetPlaceholders(const Hypothesis &hypo, FactorType placeholderFactor) const size_t Hypothesis::hash() const { - size_t seed = 0; + size_t seed; + + // coverage + seed = m_sourceCompleted.hash(); + + // states for (size_t i = 0; i < m_ffStates.size(); ++i) { const FFState *state = m_ffStates[i]; size_t hash = state->hash(); @@ -631,6 +636,12 @@ size_t Hypothesis::hash() const bool Hypothesis::operator==(const Hypothesis& other) const { + // coverage + if (m_sourceCompleted != other.m_sourceCompleted) { + return false; + } + + // states for (size_t i = 0; i < m_ffStates.size(); ++i) { const FFState &thisState = *m_ffStates[i]; const FFState &otherState = *other.m_ffStates[i]; |