Skip to content

Commit 766b7bd

Browse files
amitdozdenop
authored andcommitted
Don't drop words with low certainty (#1264)
Fix #681.
1 parent af6994e commit 766b7bd

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

ccmain/linerec.cpp

+2-15
Original file line numberDiff line numberDiff line change
@@ -291,21 +291,8 @@ void Tesseract::SearchWords(PointerVector<WERD_RES>* words) {
291291
word->best_choice->print();
292292
}
293293
word->best_choice->set_certainty(word_certainty);
294-
// Discard words that are impossibly bad, but allow a bit more for
295-
// dictionary words, and keep bad words in non-space-delimited langs.
296-
if (word_certainty >= RecodeBeamSearch::kMinCertainty ||
297-
any_nonspace_delimited ||
298-
(word_certainty >= kWorstDictCertainty &&
299-
Dict::valid_word_permuter(word->best_choice->permuter(), true))) {
300-
word->tess_accepted = stopper_dict->AcceptableResult(word);
301-
} else {
302-
if (getDict().stopper_debug_level >= 1) {
303-
tprintf("Deleting word with certainty %g\n", word_certainty);
304-
word->best_choice->print();
305-
}
306-
// It is a dud.
307-
word->SetupFake(lstm_recognizer_->GetUnicharset());
308-
}
294+
295+
word->tess_accepted = stopper_dict->AcceptableResult(word);
309296
}
310297
}
311298
}

0 commit comments

Comments
 (0)