Merge pull request #2268 from Shreeshrii/grapheme

Remove test for Word started with a combiner
This commit is contained in:
zdenop 2019-02-25 20:59:40 +01:00 committed by GitHub
commit 9ddf267907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,11 +15,12 @@ bool ValidateGrapheme::ConsumeGraphemeIfValid() {
char32 ch = codes_[codes_used_].second; char32 ch = codes_[codes_used_].second;
const bool is_combiner = const bool is_combiner =
cc == CharClass::kCombiner || cc == CharClass::kVirama; cc == CharClass::kCombiner || cc == CharClass::kVirama;
// Reject easily detected badly formed sequences. // TODO: Reject easily detected badly formed sequences.
if (prev_cc == CharClass::kWhitespace && is_combiner) { // https://github.com/tesseract-ocr/tesseract/pull/2266#issuecomment-467114751
if (report_errors_) tprintf("Word started with a combiner:0x%x\n", ch); // if (prev_cc == CharClass::kWhitespace && is_combiner) {
return false; // if (report_errors_) tprintf("Word started with a combiner:0x%x\n", ch);
} // return false;
//}
if (prev_cc == CharClass::kVirama && cc == CharClass::kVirama) { if (prev_cc == CharClass::kVirama && cc == CharClass::kVirama) {
if (report_errors_) if (report_errors_)
tprintf("Two grapheme links in a row:0x%x 0x%x\n", prev_ch, ch); tprintf("Two grapheme links in a row:0x%x 0x%x\n", prev_ch, ch);