Tesseract
3.02
|
#include <pageres.h>
BlamerBundle::BlamerBundle | ( | ) | [inline] |
Definition at line 99 of file pageres.h.
: truth_has_char_boxes(false), incorrect_result_reason(IRR_CORRECT), lattice_data(NULL) { ClearResults(); }
BlamerBundle::~BlamerBundle | ( | ) | [inline] |
Definition at line 102 of file pageres.h.
{ delete[] lattice_data; }
BlamerBundle::BlamerBundle | ( | const BlamerBundle & | other | ) | [inline] |
Definition at line 142 of file pageres.h.
{ this->CopyTruth(other); this->CopyResults(other); }
void BlamerBundle::ClearResults | ( | ) | [inline] |
Definition at line 103 of file pageres.h.
{ norm_truth_word.DeleteAllBoxes(); norm_box_tolerance = 0; if (!NoTruth()) incorrect_result_reason = IRR_CORRECT; debug = ""; segsearch_is_looking_for_blame = false; best_correctly_segmented_rating = WERD_CHOICE::kBadRating; correct_segmentation_cols.clear(); correct_segmentation_rows.clear(); best_choice_is_dict_and_top_choice = false; delete[] lattice_data; lattice_data = NULL; lattice_size = 0; }
void BlamerBundle::CopyResults | ( | const BlamerBundle & | other | ) | [inline] |
Definition at line 124 of file pageres.h.
{ norm_truth_word = other.norm_truth_word; norm_box_tolerance = other.norm_box_tolerance; incorrect_result_reason = other.incorrect_result_reason; segsearch_is_looking_for_blame = other.segsearch_is_looking_for_blame; best_correctly_segmented_rating =other.best_correctly_segmented_rating; correct_segmentation_cols = other.correct_segmentation_cols; correct_segmentation_rows = other.correct_segmentation_rows; best_choice_is_dict_and_top_choice = other.best_choice_is_dict_and_top_choice; if (other.lattice_data != NULL) { lattice_data = new char[other.lattice_size]; memcpy(lattice_data, other.lattice_data, other.lattice_size); lattice_size = other.lattice_size; } else { lattice_data = NULL; } }
void BlamerBundle::CopyTruth | ( | const BlamerBundle & | other | ) | [inline] |
Definition at line 117 of file pageres.h.
{ truth_has_char_boxes = other.truth_has_char_boxes; truth_word = other.truth_word; truth_text = other.truth_text; incorrect_result_reason = (other.NoTruth() ? other.incorrect_result_reason : IRR_CORRECT); }
void BlamerBundle::FillDebugString | ( | const STRING & | msg, |
const WERD_CHOICE * | choice, | ||
STRING * | debug | ||
) |
Definition at line 63 of file pageres.cpp.
{ (*debug) += "Truth "; for (int i = 0; i < this->truth_text.length(); ++i) { (*debug) += this->truth_text[i]; } if (!this->truth_has_char_boxes) (*debug) += " (no char boxes)"; if (choice != NULL) { (*debug) += " Choice "; STRING choice_str; choice->string_and_lengths(&choice_str, NULL); (*debug) += choice_str; } if (msg.length() > 0) { (*debug) += "\n"; (*debug) += msg; } (*debug) += "\n"; }
const char * BlamerBundle::IncorrectReason | ( | ) | const |
Definition at line 59 of file pageres.cpp.
{ return kIncorrectResultReasonNames[incorrect_result_reason]; }
const char * BlamerBundle::IncorrectReasonName | ( | IncorrectResultReason | irr | ) | [static] |
Definition at line 55 of file pageres.cpp.
{ return kIncorrectResultReasonNames[irr]; }
bool BlamerBundle::NoTruth | ( | ) | const [inline] |
Definition at line 147 of file pageres.h.
{ return (incorrect_result_reason == IRR_NO_TRUTH || incorrect_result_reason == IRR_PAGE_LAYOUT); }
void BlamerBundle::SetBlame | ( | IncorrectResultReason | irr, |
const STRING & | msg, | ||
const WERD_CHOICE * | choice, | ||
bool | debug | ||
) | [inline] |
Definition at line 151 of file pageres.h.
{ this->incorrect_result_reason = irr; this->debug = this->IncorrectReason(); this->debug += " to blame: "; this->FillDebugString(msg, choice, &(this->debug)); if (debug) tprintf("SetBlame(): %s", this->debug.string()); }