41 static const inT16 kBlamerBoxTolerance = 5;
155 this->debug +=
" to blame: ";
157 if (debug)
tprintf(
"SetBlame(): %s", this->debug.string());
239 prev_word_best_choice =
NULL;
245 PAGE_RES(BLOCK_LIST *block_list,
477 const char*
const BestUTF8(
int blob_index,
bool in_rtl_context)
const {
481 if (id < 0 || id >=
uch_set->
size() ||
id == INVALID_UNICHAR_ID)
484 if (in_rtl_context && mirrored > 0 && mirrored != INVALID_UNICHAR_ID)
489 const char*
const RawUTF8(
int blob_index)
const {
493 if (id < 0 || id >=
uch_set->
size() ||
id == INVALID_UNICHAR_ID)
511 if (unichar_id < 0 || unichar_id >=
uch_set->
size())
528 if (unichar_id < 0 || unichar_id >=
uch_set->
size())
569 bool numeric_mode,
bool use_body_size,
628 int *start,
int *end)
const;
648 BLOB_CHOICE_LIST_CLIST *blob_choices);
653 void fix_quotes(BLOB_CHOICE_LIST_CLIST *blob_choices);
661 void fix_hyphens(BLOB_CHOICE_LIST_CLIST *blob_choices);
738 return internal_forward(
false,
false);
742 return internal_forward(
false,
true);
749 return prev_word_res;
755 return prev_block_res;
767 return next_word_res;
773 return next_block_res;
778 void ResetWordIterator();
779 WERD_RES *internal_forward(
bool new_block,
bool empty_ok);
793 BLOCK_RES_IT block_res_it;
794 ROW_RES_IT row_res_it;
795 WERD_RES_IT word_res_it;
bool unichars_in_script_order() const
WERD_RES(const WERD_RES &source)
bool SetupForTessRecognition(const UNICHARSET &unicharset_in, tesseract::Tesseract *tesseract, Pix *pix, bool numeric_mode, bool use_body_size, ROW *row, BLOCK *block)
BLOCK_RES * prev_block() const
const char *const id_to_unichar_ext(UNICHAR_ID id) const
const char * IncorrectReason() const
ROW_RES * next_row() const
const char *const id_to_unichar(UNICHAR_ID id) const
IncorrectResultReason incorrect_result_reason
WERD_RES * forward_block()
GenericVector< int > correct_segmentation_cols
UNICHAR_ID BothQuotes(UNICHAR_ID id1, UNICHAR_ID id2)
WERD_RES * InsertSimpleCloneWord(const WERD_RES &clone_res, WERD *new_word)
void ConsumeWordResults(WERD_RES *word)
BLOCK_RES_LIST block_res_list
const FontInfo * fontinfo
bool SetupForCubeRecognition(const UNICHARSET &unicharset_in, tesseract::Tesseract *tesseract, const BLOCK *block)
bool ConditionalBlobMerge(TessResultCallback2< UNICHAR_ID, UNICHAR_ID, UNICHAR_ID > *class_cb, TessResultCallback2< bool, const TBOX &, const TBOX & > *box_cb, BLOB_CHOICE_LIST_CLIST *blob_choices)
bool best_choice_is_dict_and_top_choice
const FontInfo * fontinfo2
GenericVector< WERD_CHOICE * > alt_choices
WERD_RES * start_page(bool empty_ok)
tesseract::Tesseract * tesseract
const char *const BestUTF8(int blob_index, bool in_rtl_context) const
BLOCK_RES * next_block() const
WERD_RES * restart_page()
float best_correctly_segmented_rating
WERD_RES * forward_paragraph()
void FillDebugString(const STRING &msg, const WERD_CHOICE *choice, STRING *debug)
WERD_RES_LIST word_res_list
UNICHAR_ID BothSpaces(UNICHAR_ID id1, UNICHAR_ID id2)
GenericVector< int > best_state
bool HyphenBoxesOverlap(const TBOX &box1, const TBOX &box2)
void copy_on(WERD *other)
void CopyTruth(const BlamerBundle &other)
#define CLISTIZEH(CLASSNAME)
GenericVector< GenericVector< int > > alt_states
static WERD_RES * deep_copy(const WERD_RES *src)
UNICHAR_ID BothHyphens(UNICHAR_ID id1, UNICHAR_ID id2)
void fix_hyphens(BLOB_CHOICE_LIST_CLIST *blob_choices)
BOOL8 flag(WERD_FLAGS mask) const
bool operator==(const PAGE_RES_IT &other) const
GenericVector< inT8 > best_choice_fontinfo_ids
tesseract::BoxWord truth_word
void CloneChoppedToRebuild()
BLOCK_RES * block() const
bool UnicharsInReadingOrder() const
tesseract::BoxWord norm_truth_word
const UNICHARSET * uch_set
bool PiecesAllNatural(int start, int count) const
WERD_RES * next_word() const
UNICHARSET::Direction SymbolDirection(int blob_index) const
GenericVector< STRING > truth_text
tesseract::ParamsTrainingBundle params_training_bundle
void WithoutFootnoteSpan(int *start, int *end) const
void SetBlame(IncorrectResultReason irr, const STRING &msg, const WERD_CHOICE *choice, bool debug)
tesseract::BoxWord * bln_boxes
void set_flag(WERD_FLAGS mask, BOOL8 value)
BlamerBundle(const BlamerBundle &other)
WERD_RES * forward_with_empties()
static const float kBadRating
ROW_RES_LIST row_res_list
void CopyResults(const BlamerBundle &other)
DLLSYM void tprintf(const char *format,...)
WERD_CHOICE ** prev_word_best_choice
inT32 whole_word_rej_count
static const char * IncorrectReasonName(IncorrectResultReason irr)
void BestChoiceToCorrectText()
ROW_RES * prev_row() const
bool AnyLtrCharsInWord() const
GenericVector< int > blame_reasons
bool AnyRtlCharsInWord() const
GenericVector< STRING > correct_text
bool truth_has_char_boxes
tesseract::BoxWord * box_word
bool operator!=(const PAGE_RES_IT &other) const
GenericVector< STRING > misadaption_log
void CopySimpleFields(const WERD_RES &source)
void SetupFake(const UNICHARSET &uch)
UNICHAR_ID get_mirror(UNICHAR_ID unichar_id) const
void SetupWordScript(const UNICHARSET &unicharset_in)
void SetScriptPositions()
void FakeClassifyWord(int blob_count, BLOB_CHOICE **choices)
bool segsearch_is_looking_for_blame
Direction get_direction(UNICHAR_ID unichar_id) const
WERD_RES * prev_word() const
void ReplaceBestChoice(const WERD_CHOICE &choice, const GenericVector< int > &segmentation_state)
int cmp(const PAGE_RES_IT &other) const
void fix_quotes(BLOB_CHOICE_LIST_CLIST *blob_choices)
const char *const RawUTF8(int blob_index) const
void InitForRetryRecognition(const WERD_RES &source)
PAGE_RES_IT(PAGE_RES *the_page_res)
CRUNCH_MODE unlv_crunch_mode
GenericVector< int > correct_segmentation_rows
WERD_RES * restart_page_with_empties()
void copy_on(WERD_RES *word_res)
const UNICHAR_ID unichar_id(int index) const
void init_to_size(int size, T t)
BlamerBundle * blamer_bundle
WERD_CHOICE * best_choice
WERD_RES & operator=(const WERD_RES &source)