more placeholder code and 'NO BEST TRANSLATION' to stderr for pb

This commit is contained in:
Hieu Hoang 2013-09-18 23:47:50 +02:00
parent b518b17cfa
commit a40d9082cd
2 changed files with 12 additions and 0 deletions

View File

@ -304,6 +304,10 @@ public:
debug << "BEST TRANSLATION: " << *bestHypo << endl;
}
}
else {
VERBOSE(1, "NO BEST TRANSLATION" << endl);
}
out << endl;
}

View File

@ -928,6 +928,14 @@ bool ExtractTask::checkPlaceholders (const SentenceAlignment &sentence, int star
if (sentence.alignedToT[pos].size() != 1) {
return false;
}
else {
// check it actually lines up to another placeholder
int targetPos = sentence.alignedToT[pos][0];
const string &otherWord = sentence.target[targetPos];
if (!isPlaceholder(otherWord)) {
return false;
}
}
}
}