diff options
author | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-04-28 21:18:38 +0400 |
---|---|---|
committer | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-04-28 21:18:38 +0400 |
commit | 20381cbf8996ea46d32c470c8580a68eda4ec64e (patch) | |
tree | b925ad630058c7f642f20af534829ccac2decaa2 /moses/Phrase.cpp | |
parent | 03825e3ffdd1042ba02a64981ebb2e4c731ef153 (diff) | |
parent | 6182750b7077f226f2eb96a8b5b97be72d274c74 (diff) |
merged master into dynamic-models and solved conflicts
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r-- | moses/Phrase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/moses/Phrase.cpp b/moses/Phrase.cpp index 618e116fd..05531a2bc 100644 --- a/moses/Phrase.cpp +++ b/moses/Phrase.cpp @@ -380,6 +380,11 @@ void Phrase::InitStartEndWord() size_t Phrase::Find(const Phrase &sought, int maxUnknown) const { + if (GetSize() < sought.GetSize()) { + // sought phrase too big + return NOT_FOUND; + } + size_t maxStartPos = GetSize() - sought.GetSize(); for (size_t startThisPos = 0; startThisPos <= maxStartPos; ++startThisPos) { size_t thisPos = startThisPos; |