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:
authorNicola Bertoldi <bertoldi@fbk.eu>2014-04-28 21:18:38 +0400
committerNicola Bertoldi <bertoldi@fbk.eu>2014-04-28 21:18:38 +0400
commit20381cbf8996ea46d32c470c8580a68eda4ec64e (patch)
treeb925ad630058c7f642f20af534829ccac2decaa2 /moses/Phrase.cpp
parent03825e3ffdd1042ba02a64981ebb2e4c731ef153 (diff)
parent6182750b7077f226f2eb96a8b5b97be72d274c74 (diff)
merged master into dynamic-models and solved conflicts
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r--moses/Phrase.cpp5
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;