diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-08 19:14:08 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-08 19:14:08 +0300 |
commit | 16512ff16f824115003e78a82506d49d82ff900e (patch) | |
tree | ba74507aadc1c5f39f2d0a4ee4976262e25afb03 /moses/FF/ControlRecombination.cpp | |
parent | dc08a12f1cbea444ed0fc4bf05bbe369145ca3de (diff) |
add hash() to FFState. Get ready to use unordered_set in stacks
Diffstat (limited to 'moses/FF/ControlRecombination.cpp')
-rw-r--r-- | moses/FF/ControlRecombination.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/moses/FF/ControlRecombination.cpp b/moses/FF/ControlRecombination.cpp index f7231d9b0..072163288 100644 --- a/moses/FF/ControlRecombination.cpp +++ b/moses/FF/ControlRecombination.cpp @@ -48,6 +48,19 @@ int ControlRecombinationState::Compare(const FFState& other) const } } +size_t ControlRecombinationState::hash() const +{ + size_t ret; + if (m_ff.GetType() == SameOutput) { + ret = hash_value(m_outputPhrase); + } + else { + // compare hypo address. Won't be equal unless they're actually the same hypo + ret = (size_t) m_hypo; + } + return ret; +} + std::vector<float> ControlRecombination::DefaultWeights() const { UTIL_THROW_IF2(m_numScoreComponents, |