79 prev_word_best_choice =
NULL;
85 PAGE_RES(
bool merge_similar_words,
86 BLOCK_LIST *block_list,
136 ROW_RES(
bool merge_similar_words,
ROW *the_row);
342 const char*
const BestUTF8(
int blob_index,
bool in_rtl_context)
const {
343 if (blob_index < 0 || best_choice ==
NULL ||
344 blob_index >= best_choice->
length())
347 if (id < 0 || id >= uch_set->
size() ||
id == INVALID_UNICHAR_ID)
350 if (in_rtl_context && mirrored > 0 && mirrored != INVALID_UNICHAR_ID)
355 const char*
const RawUTF8(
int blob_index)
const {
356 if (blob_index < 0 || blob_index >= raw_choice->
length())
359 if (id < 0 || id >= uch_set->
size() ||
id == INVALID_UNICHAR_ID)
365 if (best_choice ==
NULL ||
366 blob_index >= best_choice->
length() ||
373 if (uch_set ==
NULL || best_choice ==
NULL || best_choice->
length() < 1)
375 for (
int id = 0;
id < best_choice->
length();
id++) {
377 if (unichar_id < 0 || unichar_id >= uch_set->
size())
390 if (uch_set ==
NULL || best_choice ==
NULL || best_choice->
length() < 1)
392 for (
int id = 0;
id < best_choice->
length();
id++) {
394 if (unichar_id < 0 || unichar_id >= uch_set->
size())
410 void InitNonPointers();
414 void ClearWordChoices();
421 void CopySimpleFields(
const WERD_RES& source);
427 void InitForRetryRecognition(
const WERD_RES& source);
444 bool SetupForRecognition(
const UNICHARSET& unicharset_in,
447 const TBOX* norm_box,
bool numeric_mode,
448 bool use_body_size,
bool allow_detailed_fx,
454 void SetupBasicsFromChoppedWord(
const UNICHARSET &unicharset_in);
461 void SetupWordScript(
const UNICHARSET& unicharset_in);
464 void SetupBlamerBundle();
467 void SetupBlobWidthsAndGaps();
472 void InsertSeam(
int blob_number,
SEAM* seam);
476 bool AlternativeChoiceAdjustmentsWorseThan(
float threshold)
const;
484 bool StatesAllValid();
488 void DebugWordChoices(
bool debug,
const char* word_to_debug);
491 void DebugTopChoice(
const char* msg)
const;
495 void FilterWordChoices(
int debug_level);
512 void ComputeAdaptionThresholds(
float certainty_scale,
527 bool LogNewCookedChoice(
int max_num_choices,
bool debug,
531 void PrintBestChoices()
const;
535 int GetBlobsWidth(
int start_blob,
int last_blob);
537 int GetBlobsGap(
int blob_index);
548 BLOB_CHOICE_LIST* GetBlobChoices(
int index)
const;
558 void ConsumeWordResults(
WERD_RES* word);
566 void RebuildBestState();
570 void CloneChoppedToRebuild();
577 void SetScriptPositions();
589 void FakeClassifyWord(
int blob_count,
BLOB_CHOICE** choices);
593 void FakeWordFromRatings();
596 void BestChoiceToCorrectText();
603 bool ConditionalBlobMerge(
609 void MergeAdjacentBlobs(
int index);
621 bool HyphenBoxesOverlap(
const TBOX& box1,
const TBOX& box2);
627 void merge_tess_fails();
649 bool PiecesAllNatural(
int start,
int count)
const;
664 page_res = the_page_res;
672 bool operator !=(
const PAGE_RES_IT &other)
const {
return !(*
this == other); }
681 return start_page(
false);
684 return start_page(
true);
686 WERD_RES *start_page(
bool empty_ok);
707 void DeleteCurrentWord();
711 void MakeCurrentWordFuzzy();
714 return internal_forward(
false,
false);
718 return internal_forward(
false,
true);
725 return prev_word_res;
731 return prev_block_res;
743 return next_word_res;
749 return next_block_res;
751 void rej_stat_word();
752 void ResetWordIterator();
755 WERD_RES *internal_forward(
bool new_block,
bool empty_ok);
769 BLOCK_RES_IT block_res_it;
770 ROW_RES_IT row_res_it;
771 WERD_RES_IT word_res_it;
PAGE_RES_IT(PAGE_RES *the_page_res)
GenericVector< STRING > correct_text
#define CLISTIZEH(CLASSNAME)
BOOL8 flag(WERD_FLAGS mask) const
GenericVector< int > blob_widths
WERD_CHOICE ** prev_word_best_choice
WERD_RES * prev_word() const
WERD_RES * restart_page_with_empties()
UNICHAR_ID get_mirror(UNICHAR_ID unichar_id) const
BlamerBundle * blamer_bundle
GenericVector< STRING > misadaption_log
WERD_RES * restart_page()
WERD_CHOICE_LIST best_choices
const UNICHARSET * uch_set
const char *const RawUTF8(int blob_index) const
const FontInfo * fontinfo
bool AnyRtlCharsInWord() const
tesseract::Tesseract * tesseract
GenericVector< int > blame_reasons
ROW_RES * next_row() const
const UNICHAR_ID unichar_id(int index) const
static WERD_RES * deep_copy(const WERD_RES *src)
inT32 whole_word_rej_count
WERD_RES * forward_with_empties()
bool UnicharsInReadingOrder() const
UNICHARSET::Direction SymbolDirection(int blob_index) const
BLOCK_RES * prev_block() const
WERD_RES_LIST word_res_list
GenericVector< SEAM * > seam_array
void init_to_size(int size, T t)
const FontInfo * fontinfo2
WERD_RES * next_word() const
GenericVector< int > blob_gaps
CRUNCH_MODE unlv_crunch_mode
BLOCK_RES * block() const
const char *const id_to_unichar_ext(UNICHAR_ID id) const
void copy_on(WERD_RES *word_res)
ROW_RES * prev_row() const
Direction get_direction(UNICHAR_ID unichar_id) const
tesseract::BoxWord * bln_boxes
const char *const BestUTF8(int blob_index, bool in_rtl_context) const
const char *const id_to_unichar(UNICHAR_ID id) const
WERD_RES(const WERD_RES &source)
MATRIX * DeepCopy() const
tesseract::BoxWord * box_word
BLOCK_RES_LIST block_res_list
BLOCK_RES * next_block() const
bool unichars_in_script_order() const
bool AnyLtrCharsInWord() const
GenericVector< int > best_state
WERD_CHOICE * best_choice
ROW_RES_LIST row_res_list