diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-17 05:13:32 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-17 05:13:32 +0400 |
commit | 21319acb8806079fffe548185eafcb74ab94f9e3 (patch) | |
tree | 5c2cb7dfff0a4e91fcf72283751018ab028250e6 /moses/Phrase.cpp | |
parent | 8b2bed458c0c52bc65449cc6105cba60afb16120 (diff) |
implement ConstrainedDecoding FF
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r-- | moses/Phrase.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/moses/Phrase.cpp b/moses/Phrase.cpp index 77d117163..ae0572357 100644 --- a/moses/Phrase.cpp +++ b/moses/Phrase.cpp @@ -373,7 +373,7 @@ void Phrase::InitStartEndWord() AddWord(endWord); } -bool Phrase::Contains(const Phrase &sought) const +size_t Phrase::Find(const Phrase &sought) const { size_t maxStartPos = GetSize() - sought.GetSize(); for (size_t startThisPos = 0; startThisPos <= maxStartPos; ++startThisPos) { @@ -392,13 +392,11 @@ bool Phrase::Contains(const Phrase &sought) const } if (soughtPos == sought.GetSize()) { - cerr << "searched=" << *this << endl; - cerr << "sought=" << sought << endl; - return true; + return startThisPos; } } - return false; + return NOT_FOUND; } TO_STRING_BODY(Phrase); |