From fd1b451374bf94b1d55b691fb6472f51b6ac0107 Mon Sep 17 00:00:00 2001 From: Robert Mast Date: Mon, 15 Aug 2022 13:26:55 +0000 Subject: [PATCH 1/2] This might be the fix for the upper disappearing word of issue 3871 --- src/textord/tordmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textord/tordmain.cpp b/src/textord/tordmain.cpp index a7f2a168f3..c5e4521be9 100644 --- a/src/textord/tordmain.cpp +++ b/src/textord/tordmain.cpp @@ -674,7 +674,7 @@ void Textord::clean_small_noise_from_words(ROW *row) { delete blob_it.extract(); } } - if (word->cblob_list()->empty()) { + if (word->cblob_list()->empty() && word->rej_cblob_list()->empty()) { if (!word_it.at_last()) { // The next word is no longer a fuzzy non space if it was before, // since the word before is about to be deleted. From 892e614a6b3822f998b1a531443c197d421a0180 Mon Sep 17 00:00:00 2001 From: Robert Mast Date: Fri, 19 Aug 2022 09:11:11 +0000 Subject: [PATCH 2/2] Just eliminate parent blob, keeping smaller blobs contained --- src/ccstruct/stepblob.cpp | 4 +--- src/textord/tordmain.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ccstruct/stepblob.cpp b/src/ccstruct/stepblob.cpp index 4c61b6c659..546a9759b6 100644 --- a/src/ccstruct/stepblob.cpp +++ b/src/ccstruct/stepblob.cpp @@ -208,9 +208,7 @@ void C_BLOB::ConstructBlobsFromOutlines(bool good_blob, C_OUTLINE_LIST *outline_ // Set inverse flag and reverse if needed. blob->CheckInverseFlagAndDirection(); // Put on appropriate list. - if (!blob_is_good && bad_blobs_it != nullptr) { - bad_blobs_it->add_after_then_move(blob); - } else { + if (!(!blob_is_good && bad_blobs_it != nullptr)) { good_blobs_it->add_after_then_move(blob); } } diff --git a/src/textord/tordmain.cpp b/src/textord/tordmain.cpp index c5e4521be9..a7f2a168f3 100644 --- a/src/textord/tordmain.cpp +++ b/src/textord/tordmain.cpp @@ -674,7 +674,7 @@ void Textord::clean_small_noise_from_words(ROW *row) { delete blob_it.extract(); } } - if (word->cblob_list()->empty() && word->rej_cblob_list()->empty()) { + if (word->cblob_list()->empty()) { if (!word_it.at_last()) { // The next word is no longer a fuzzy non space if it was before, // since the word before is about to be deleted.