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);
345 const char*
BestUTF8(
int blob_index,
bool in_rtl_context)
const {
346 if (blob_index < 0 || best_choice == NULL ||
347 blob_index >= best_choice->
length())
350 if (id < 0 || id >= uch_set->
size() ||
id == INVALID_UNICHAR_ID)
353 if (in_rtl_context && mirrored > 0 && mirrored != INVALID_UNICHAR_ID)
359 if (blob_index < 0 || blob_index >= raw_choice->
length())
362 if (id < 0 || id >= uch_set->
size() ||
id == INVALID_UNICHAR_ID)
368 if (best_choice == NULL ||
369 blob_index >= best_choice->
length() ||
376 if (uch_set == NULL || best_choice == NULL || best_choice->
length() < 1)
378 for (
int id = 0;
id < best_choice->
length();
id++) {
380 if (unichar_id < 0 || unichar_id >= uch_set->
size())
393 if (uch_set == NULL || best_choice == NULL || best_choice->
length() < 1)
395 for (
int id = 0;
id < best_choice->
length();
id++) {
397 if (unichar_id < 0 || unichar_id >= uch_set->
size())
413 void InitNonPointers();
417 void ClearWordChoices();
424 void CopySimpleFields(
const WERD_RES& source);
430 void InitForRetryRecognition(
const WERD_RES& source);
447 bool SetupForRecognition(
const UNICHARSET& unicharset_in,
450 const TBOX* norm_box,
bool numeric_mode,
451 bool use_body_size,
bool allow_detailed_fx,
457 void SetupBasicsFromChoppedWord(
const UNICHARSET &unicharset_in);
464 void SetupWordScript(
const UNICHARSET& unicharset_in);
467 void SetupBlamerBundle();
470 void SetupBlobWidthsAndGaps();
475 void InsertSeam(
int blob_number,
SEAM* seam);
479 bool AlternativeChoiceAdjustmentsWorseThan(
float threshold)
const;
487 bool StatesAllValid();
491 void DebugWordChoices(
bool debug,
const char* word_to_debug);
494 void DebugTopChoice(
const char* msg)
const;
498 void FilterWordChoices(
int debug_level);
515 void ComputeAdaptionThresholds(
float certainty_scale,
530 bool LogNewCookedChoice(
int max_num_choices,
bool debug,
534 void PrintBestChoices()
const;
538 int GetBlobsWidth(
int start_blob,
int last_blob);
540 int GetBlobsGap(
int blob_index);
551 BLOB_CHOICE_LIST* GetBlobChoices(
int index)
const;
561 void ConsumeWordResults(
WERD_RES* word);
569 void RebuildBestState();
573 void CloneChoppedToRebuild();
580 void SetScriptPositions();
592 void FakeClassifyWord(
int blob_count,
BLOB_CHOICE** choices);
599 void BestChoiceToCorrectText();
606 bool ConditionalBlobMerge(
612 void MergeAdjacentBlobs(
int index);
624 bool HyphenBoxesOverlap(
const TBOX& box1,
const TBOX& box2);
630 void merge_tess_fails();
652 bool PiecesAllNatural(
int start,
int count)
const;
667 page_res = the_page_res;
675 bool operator !=(
const PAGE_RES_IT &other)
const {
return !(*
this == other); }
684 return start_page(
false);
687 return start_page(
true);
689 WERD_RES *start_page(
bool empty_ok);
710 void DeleteCurrentWord();
714 void MakeCurrentWordFuzzy();
717 return internal_forward(
false,
false);
721 return internal_forward(
false,
true);
728 return prev_word_res;
734 return prev_block_res;
746 return next_word_res;
752 return next_block_res;
754 void rej_stat_word();
755 void ResetWordIterator();
758 WERD_RES *internal_forward(
bool new_block,
bool empty_ok);
772 BLOCK_RES_IT block_res_it;
773 ROW_RES_IT row_res_it;
774 WERD_RES_IT word_res_it;
ROW_RES_LIST row_res_list
WERD_RES * next_word() const
UNICHAR_ID unichar_id(int index) const
void init_to_size(int size, T t)
GenericVector< int > best_state
const FontInfo * fontinfo2
WERD_CHOICE * best_choice
ROW_RES * prev_row() const
BlamerBundle * blamer_bundle
bool AnyRtlCharsInWord() const
BLOCK_RES_LIST block_res_list
GenericVector< STRING > correct_text
PAGE_RES_IT(PAGE_RES *the_page_res)
GenericVector< int > blob_widths
tesseract::Tesseract * tesseract
tesseract::BoxWord * box_word
Direction get_direction(UNICHAR_ID unichar_id) const
BOOL8 flag(WERD_FLAGS mask) const
const char * id_to_unichar(UNICHAR_ID id) const
WERD_RES * forward_with_empties()
ROW_RES * next_row() const
void copy_on(WERD_RES *word_res)
WERD_RES * restart_page()
WERD_CHOICE ** prev_word_best_choice
WERD_RES * restart_page_with_empties()
const char * id_to_unichar_ext(UNICHAR_ID id) const
inT32 whole_word_rej_count
WERD_CHOICE_LIST best_choices
UNICHAR_ID get_mirror(UNICHAR_ID unichar_id) const
const FontInfo * fontinfo
bool UnicharsInReadingOrder() const
CRUNCH_MODE unlv_crunch_mode
BLOCK_RES * next_block() const
const char * RawUTF8(int blob_index) const
tesseract::BoxWord * bln_boxes
WERD_RES(const WERD_RES &source)
const char * BestUTF8(int blob_index, bool in_rtl_context) const
GenericVector< int > blob_gaps
MATRIX * DeepCopy() const
WERD_RES * prev_word() const
UNICHARSET::Direction SymbolDirection(int blob_index) const
const UNICHARSET * uch_set
WERD_RES_LIST word_res_list
BLOCK_RES * prev_block() const
bool unichars_in_script_order() const
#define CLISTIZEH(CLASSNAME)
bool AnyLtrCharsInWord() const
GenericVector< STRING > misadaption_log
GenericVector< int > blame_reasons
static WERD_RES * deep_copy(const WERD_RES *src)
BLOCK_RES * block() const
GenericVector< SEAM * > seam_array