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:14:24 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-17 22:14:24 +0300
commit563552aea6c6de060ef36788609867ef6bd851fb (patch)
tree9902233443b38d36a8e930efc355a5e58a7f46bc /moses/Phrase.cpp
parent0c3fea4014efc8499b0d43fb93d124d27dc9449a (diff)
clean up states after API change
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r--moses/Phrase.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/moses/Phrase.cpp b/moses/Phrase.cpp
index 7a9e847ba..d689b2ddb 100644
--- a/moses/Phrase.cpp
+++ b/moses/Phrase.cpp
@@ -253,6 +253,25 @@ int Phrase::Compare(const Phrase &other) const
return 0;
}
+bool Phrase::operator== (const Phrase &other) const {
+ size_t thisSize = GetSize()
+ ,compareSize = other.GetSize();
+ if (thisSize != compareSize) {
+ return false;
+ }
+
+ for (size_t pos = 0 ; pos < thisSize ; pos++) {
+ const Word &thisWord = GetWord(pos)
+ ,&otherWord = other.GetWord(pos);
+ bool ret = thisWord == otherWord;
+ if (!ret) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool Phrase::Contains(const vector< vector<string> > &subPhraseVector
, const vector<FactorType> &inputFactor) const