@@ -137,7 +137,7 @@ int16_t Tesseract::count_outline_errs(char c, int16_t outline_count) {
137
137
}
138
138
139
139
void Tesseract::quality_based_rejection (PAGE_RES_IT &page_res_it,
140
- BOOL8 good_quality_doc) {
140
+ bool good_quality_doc) {
141
141
if ((tessedit_good_quality_unrej && good_quality_doc))
142
142
unrej_good_quality_words (page_res_it);
143
143
doc_and_block_rejection (page_res_it, good_quality_doc);
@@ -232,14 +232,14 @@ void Tesseract::unrej_good_quality_words( //unreject potential
232
232
233
233
void Tesseract::doc_and_block_rejection ( // reject big chunks
234
234
PAGE_RES_IT &page_res_it,
235
- BOOL8 good_quality_doc) {
235
+ bool good_quality_doc) {
236
236
int16_t block_no = 0 ;
237
237
int16_t row_no = 0 ;
238
238
BLOCK_RES *current_block;
239
239
ROW_RES *current_row;
240
240
241
- BOOL8 rej_word;
242
- BOOL8 prev_word_rejected;
241
+ bool rej_word;
242
+ bool prev_word_rejected;
243
243
int16_t char_quality = 0 ;
244
244
int16_t accepted_char_quality;
245
245
@@ -273,7 +273,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
273
273
block_no, current_block->char_count ,
274
274
current_block->rej_count );
275
275
}
276
- prev_word_rejected = FALSE ;
276
+ prev_word_rejected = false ;
277
277
while ((word = page_res_it.word ()) != nullptr &&
278
278
(page_res_it.block () == current_block)) {
279
279
if (tessedit_preserve_blk_rej_perfect_wds) {
@@ -292,7 +292,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
292
292
rej_word = char_quality != word->reject_map .length ();
293
293
}
294
294
} else {
295
- rej_word = TRUE ;
295
+ rej_word = true ;
296
296
}
297
297
if (rej_word) {
298
298
/*
@@ -339,7 +339,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
339
339
row_no, current_row->char_count ,
340
340
current_row->rej_count );
341
341
}
342
- prev_word_rejected = FALSE ;
342
+ prev_word_rejected = false ;
343
343
while ((word = page_res_it.word ()) != nullptr &&
344
344
page_res_it.row () == current_row) {
345
345
/* Preserve words on good docs unless they are mostly rejected*/
@@ -363,7 +363,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
363
363
rej_word = char_quality != word->reject_map .length ();
364
364
}
365
365
} else {
366
- rej_word = TRUE ;
366
+ rej_word = true ;
367
367
}
368
368
if (rej_word) {
369
369
/*
@@ -419,8 +419,8 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
419
419
WERD_RES *word;
420
420
GARBAGE_LEVEL garbage_level;
421
421
PAGE_RES_IT copy_it;
422
- BOOL8 prev_potential_marked = FALSE ;
423
- BOOL8 found_terrible_word = FALSE ;
422
+ bool prev_potential_marked = false ;
423
+ bool found_terrible_word = false ;
424
424
BOOL8 ok_dict_word;
425
425
426
426
page_res_it.restart_page ();
@@ -439,13 +439,13 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
439
439
word->merge_tess_fails ();
440
440
441
441
if (word->reject_map .accept_count () != 0 ) {
442
- found_terrible_word = FALSE ;
442
+ found_terrible_word = false ;
443
443
// Forget earlier potential crunches
444
- prev_potential_marked = FALSE ;
444
+ prev_potential_marked = false ;
445
445
}
446
446
else {
447
447
ok_dict_word = safe_dict_word (word);
448
- garbage_level = garbage_word (word, ok_dict_word);
448
+ garbage_level = garbage_word (word, ok_dict_word);
449
449
450
450
if ((garbage_level != G_NEVER_CRUNCH) &&
451
451
(terrible_word_crunch (word, garbage_level))) {
@@ -463,9 +463,9 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
463
463
copy_it.word ()->unlv_crunch_mode = CR_KEEP_SPACE;
464
464
copy_it.forward ();
465
465
}
466
- prev_potential_marked = FALSE ;
466
+ prev_potential_marked = false ;
467
467
}
468
- found_terrible_word = TRUE ;
468
+ found_terrible_word = true ;
469
469
}
470
470
else if ((garbage_level != G_NEVER_CRUNCH) &&
471
471
(potential_word_crunch (word,
@@ -479,17 +479,17 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
479
479
}
480
480
else if (!prev_potential_marked) {
481
481
copy_it = page_res_it;
482
- prev_potential_marked = TRUE ;
482
+ prev_potential_marked = true ;
483
483
if (crunch_debug > 1 ) {
484
484
tprintf (" P3 CRUNCHING: \" %s\"\n " ,
485
485
word->best_choice ->unichar_string ().string ());
486
486
}
487
487
}
488
488
}
489
489
else {
490
- found_terrible_word = FALSE ;
490
+ found_terrible_word = false ;
491
491
// Forget earlier potential crunches
492
- prev_potential_marked = FALSE ;
492
+ prev_potential_marked = false ;
493
493
if (crunch_debug > 2 ) {
494
494
tprintf (" NO CRUNCH: \" %s\"\n " ,
495
495
word->best_choice ->unichar_string ().string ());
@@ -546,7 +546,7 @@ BOOL8 Tesseract::potential_word_crunch(WERD_RES *word,
546
546
int adjusted_len;
547
547
const char *str = word->best_choice ->unichar_string ().string ();
548
548
const char *lengths = word->best_choice ->unichar_lengths ().string ();
549
- BOOL8 word_crunchable;
549
+ bool word_crunchable;
550
550
int poor_indicator_count = 0 ;
551
551
552
552
word_crunchable = !crunch_leave_accept_strings ||
@@ -590,8 +590,8 @@ BOOL8 Tesseract::potential_word_crunch(WERD_RES *word,
590
590
void Tesseract::tilde_delete (PAGE_RES_IT &page_res_it) {
591
591
WERD_RES *word;
592
592
PAGE_RES_IT copy_it;
593
- BOOL8 deleting_from_bol = FALSE ;
594
- BOOL8 marked_delete_point = FALSE ;
593
+ bool deleting_from_bol = false ;
594
+ bool marked_delete_point = false ;
595
595
int16_t debug_delete_mode;
596
596
CRUNCH_MODE delete_mode;
597
597
int16_t x_debug_delete_mode;
@@ -610,7 +610,7 @@ void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) {
610
610
word->best_choice ->unichar_string ().string ());
611
611
}
612
612
word->unlv_crunch_mode = delete_mode;
613
- deleting_from_bol = TRUE ;
613
+ deleting_from_bol = true ;
614
614
} else if (word->word ->flag (W_EOL)) {
615
615
if (marked_delete_point) {
616
616
while (copy_it.word () != word) {
@@ -631,20 +631,20 @@ void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) {
631
631
word->best_choice ->unichar_string ().string ());
632
632
}
633
633
word->unlv_crunch_mode = delete_mode;
634
- deleting_from_bol = FALSE ;
635
- marked_delete_point = FALSE ;
634
+ deleting_from_bol = false ;
635
+ marked_delete_point = false ;
636
636
}
637
637
else {
638
638
if (!marked_delete_point) {
639
639
copy_it = page_res_it;
640
- marked_delete_point = TRUE ;
640
+ marked_delete_point = true ;
641
641
}
642
642
}
643
643
}
644
644
else {
645
- deleting_from_bol = FALSE ;
645
+ deleting_from_bol = false ;
646
646
// Forget earlier potential crunches
647
- marked_delete_point = FALSE ;
647
+ marked_delete_point = false ;
648
648
}
649
649
/*
650
650
The following step has been left till now as the tess fails are used to
0 commit comments