diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-17 22:59:52 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-17 22:59:52 +0300 |
commit | 5754a46905346987cdcc9eead16a3a06458b787b (patch) | |
tree | 67dce59a04b5a18d54597702399dea3d9dc21b38 /moses/Word.h | |
parent | 563552aea6c6de060ef36788609867ef6bd851fb (diff) |
clean up comparison functions for Words and Phrases
Diffstat (limited to 'moses/Word.h')
-rw-r--r-- | moses/Word.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/moses/Word.h b/moses/Word.h index d82574573..d2b85296b 100644 --- a/moses/Word.h +++ b/moses/Word.h @@ -130,11 +130,6 @@ public: return !(*this == compare); } - int Compare(const Word &other) const { - return Compare(*this, other); - } - - /* static functions */ /** transitive comparison of 2 word objects. Used by operator<. @@ -159,10 +154,14 @@ public: }; struct WordComparer { - //! returns true if hypoA can be recombined with hypoB - bool operator()(const Word *a, const Word *b) const { - return *a < *b; + size_t operator()(const Word* word) const { + return word->hash(); } + + bool operator()(const Word* a, const Word* b) const { + return (*a) == (*b); + } + }; |