Don't do anything if we don't have enough ngrams

This commit is contained in:
XapaJIaMnu 2014-08-22 15:50:30 +01:00 committed by Paul Baltescu
parent 85db12549c
commit b2b1d352d4

View File

@ -46,6 +46,10 @@ void BilingualLM::EvaluateWithSourceContext(const InputType &input
, ScoreComponentCollection *estimatedFutureScore) const
{
double value = 0;
if (target_ngrams > targetPhrase.GetSize()) {
//We have too small of a phrase.
return;
}
for (size_t i = 0; i < targetPhrase.GetSize() - target_ngrams; ++i) {
//Get source word indexes