Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-10-17 22:59:52 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-17 22:59:52 +0300
commit5754a46905346987cdcc9eead16a3a06458b787b (patch)
tree67dce59a04b5a18d54597702399dea3d9dc21b38 /moses/Word.h
parent563552aea6c6de060ef36788609867ef6bd851fb (diff)
clean up comparison functions for Words and Phrases
Diffstat (limited to 'moses/Word.h')
-rw-r--r--moses/Word.h15
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);
+ }
+
};