mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 12:52:29 +03:00
error in constrained decoding
This commit is contained in:
parent
7e7cc64c1d
commit
5c633fcbf8
@ -106,7 +106,6 @@ FFState* ConstrainedDecoding::Evaluate(
|
||||
|
||||
ConstrainedDecodingState *ret = new ConstrainedDecodingState(hypo);
|
||||
const Phrase &outputPhrase = ret->GetPhrase();
|
||||
|
||||
size_t searchPos = ref->Find(outputPhrase, m_maxUnknowns);
|
||||
|
||||
float score;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user