21 #ifndef TESSERACT_CCSTRUCT_BLAMER_H_ 22 #define TESSERACT_CCSTRUCT_BLAMER_H_ 27 #include "genericvector.h" 28 #include "params_training_featdef.h" 45 static const int16_t kBlamerBoxTolerance = 5;
49 enum IncorrectResultReason {
66 IRR_CLASS_LM_TRADEOFF,
83 IRR_CLASS_OLD_LM_TRADEOFF,
173 const char* truth_str,
const TBOX& word_box);
177 const char* char_str,
const TBOX& char_box);
236 void SplitBundle(
int word1_right,
int word2_left,
bool debug,
246 const TBOX& blob_box,
247 const BLOB_CHOICE_LIST& choices,
262 const UNICHARSET& unicharset,
bool valid_permuter,
bool debug);
274 MATRIX* ratings, UNICHAR_ID wildcard_id,
275 bool debug,
STRING *debug_str,
281 bool debug,
STRING *debug_str);
344 #endif // TESSERACT_CCSTRUCT_BLAMER_H_ void CopyResults(const BlamerBundle &other)
Definition: blamer.h:206
char * lattice_data_
Definition: blamer.h:337
Definition: params_training_featdef.h:106
void SetWordTruth(const UNICHARSET &unicharset, const char *truth_str, const TBOX &word_box)
Definition: blamer.cpp:71
STRING misadaption_debug_
Definition: blamer.h:321
bool GuidedSegsearchNeeded(const WERD_CHOICE *best_choice) const
Definition: blamer.cpp:466
bool ChoiceIsCorrect(const WERD_CHOICE *word_choice) const
Definition: blamer.cpp:116
BlamerBundle()
Definition: blamer.h:102
int lattice_size_
Definition: blamer.h:338
IncorrectResultReason incorrect_result_reason() const
Definition: blamer.h:118
tesseract::BoxWord norm_truth_word_
Definition: blamer.h:311
GenericVector< int > correct_segmentation_rows_
Definition: blamer.h:332
tesseract::ParamsTrainingBundle params_training_bundle_
Definition: blamer.h:340
float best_correctly_segmented_rating_
Definition: blamer.h:328
void set_lattice_data(const char *data, int size)
Definition: blamer.h:156
void JoinBlames(const BlamerBundle &bundle1, const BlamerBundle &bundle2, bool debug)
Definition: blamer.cpp:230
int col
Definition: matrix.h:633
void set_best_choice_is_dict_and_top_choice(bool value)
Definition: blamer.h:147
STRING TruthString() const
Definition: blamer.h:112
bool truth_has_char_boxes_
Definition: blamer.h:305
Definition: unicharset.h:146
tesseract::BoxWord truth_word_
Definition: blamer.h:308
Definition: params_training_featdef.h:132
void CopyTruth(const BlamerBundle &other)
Definition: blamer.h:199
void FinishSegSearch(const WERD_CHOICE *best_choice, bool debug, STRING *debug_str)
Definition: blamer.cpp:511
void SetupNormTruthWord(const DENORM &denorm)
Definition: blamer.cpp:150
~BlamerBundle()
Definition: blamer.h:109
int32_t length() const
Definition: strngs.cpp:191
int correct_segmentation_length() const
Definition: blamer.h:138
void clear()
Definition: genericvector.h:868
static const char * IncorrectReasonName(IncorrectResultReason irr)
Definition: blamer.cpp:61
const char * IncorrectReason() const
Definition: blamer.cpp:65
bool NoTruth() const
Definition: blamer.h:121
IncorrectResultReason incorrect_result_reason_
Definition: blamer.h:317
const char * string() const
Definition: strngs.cpp:196
void SetupCorrectSegmentation(const TWERD *word, bool debug)
Definition: blamer.cpp:412
void SetMisAdaptionDebug(const WERD_CHOICE *best_choice, bool debug)
Definition: blamer.cpp:579
bool best_choice_is_dict_and_top_choice_
Definition: blamer.h:335
void InitForSegSearch(const WERD_CHOICE *best_choice, MATRIX *ratings, UNICHAR_ID wildcard_id, bool debug, STRING *debug_str, TessResultCallback2< bool, int, int > *pp_cb)
Definition: blamer.cpp:478
void BlameClassifier(const UNICHARSET &unicharset, const TBOX &blob_box, const BLOB_CHOICE_LIST &choices, bool debug)
Definition: blamer.cpp:262
void UpdateBestRating(float rating)
Definition: blamer.h:134
bool HasDebugInfo() const
Definition: blamer.h:125
ParamsTrainingHypothesis & AddHypothesis(const ParamsTrainingHypothesis &other)
Definition: params_training_featdef.h:142
const STRING & debug() const
Definition: blamer.h:128
int lattice_size() const
Definition: blamer.h:153
void SetSymbolTruth(const UNICHARSET &unicharset, const char *char_str, const TBOX &char_box)
Definition: blamer.cpp:91
void SetChopperBlame(const WERD_RES *word, bool debug)
Definition: blamer.cpp:315
GenericVector< STRING > truth_text_
Definition: blamer.h:315
void DeleteAllBoxes()
Definition: boxword.cpp:174
int norm_box_tolerance_
Definition: blamer.h:313
BlamerBundle & operator=(const BlamerBundle &other)
int row
Definition: matrix.h:634
void AddHypothesis(const tesseract::ParamsTrainingHypothesis &hypo)
Definition: blamer.h:166
Definition: normalis.h:50
Definition: pageres.h:169
void SetBlame(IncorrectResultReason irr, const STRING &msg, const WERD_CHOICE *choice, bool debug)
Definition: blamer.h:294
const STRING & misadaption_debug() const
Definition: blamer.h:131
void FillDebugString(const STRING &msg, const WERD_CHOICE *choice, STRING *debug)
Definition: blamer.cpp:128
static void LastChanceBlame(bool debug, WERD_RES *word)
Definition: blamer.cpp:552
bool MatrixPositionCorrect(int index, const MATRIX_COORD &coord)
Definition: blamer.h:143
void ClearResults()
Definition: blamer.h:185
GenericVector< int > correct_segmentation_cols_
Definition: blamer.h:331
void SplitBundle(int word1_right, int word2_left, bool debug, BlamerBundle *bundle1, BlamerBundle *bundle2) const
Definition: blamer.cpp:174
void BlameClassifierOrLangModel(const WERD_RES *word, const UNICHARSET &unicharset, bool valid_permuter, bool debug)
Definition: blamer.cpp:374
int length() const
Definition: genericvector.h:85
const tesseract::ParamsTrainingBundle & params_training_bundle() const
Definition: blamer.h:162
const char * lattice_data() const
Definition: blamer.h:150
static const float kBadRating
Definition: ratngs.h:275
void SetRejectedTruth()
Definition: blamer.cpp:110
bool segsearch_is_looking_for_blame_
Definition: blamer.h:325
STRING debug_
Definition: blamer.h:319
BlamerBundle(const BlamerBundle &other)
Definition: blamer.h:105
bool GuidedSegsearchStillGoing() const
Definition: blamer.cpp:506