Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BlamerBundle Struct Reference

#include <pageres.h>

Public Member Functions

 BlamerBundle ()
 
 ~BlamerBundle ()
 
void ClearResults ()
 
void CopyTruth (const BlamerBundle &other)
 
void CopyResults (const BlamerBundle &other)
 
 BlamerBundle (const BlamerBundle &other)
 
const char * IncorrectReason () const
 
bool NoTruth () const
 
void SetBlame (IncorrectResultReason irr, const STRING &msg, const WERD_CHOICE *choice, bool debug)
 
void FillDebugString (const STRING &msg, const WERD_CHOICE *choice, STRING *debug)
 

Static Public Member Functions

static const char * IncorrectReasonName (IncorrectResultReason irr)
 

Public Attributes

bool truth_has_char_boxes
 
tesseract::BoxWord truth_word
 
tesseract::BoxWord norm_truth_word
 
int norm_box_tolerance
 
GenericVector< STRINGtruth_text
 
IncorrectResultReason incorrect_result_reason
 
STRING debug
 
STRING misadaption_debug
 
bool segsearch_is_looking_for_blame
 
float best_correctly_segmented_rating
 
GenericVector< int > correct_segmentation_cols
 
GenericVector< int > correct_segmentation_rows
 
bool best_choice_is_dict_and_top_choice
 
char * lattice_data
 
int lattice_size
 
tesseract::ParamsTrainingBundle params_training_bundle
 

Detailed Description

Definition at line 97 of file pageres.h.

Constructor & Destructor Documentation

BlamerBundle::BlamerBundle ( )
inline

Definition at line 99 of file pageres.h.

99  : truth_has_char_boxes(false),
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
void ClearResults()
Definition: pageres.h:103
#define NULL
Definition: host.h:144
bool truth_has_char_boxes
Definition: pageres.h:164
char * lattice_data
Definition: pageres.h:196
BlamerBundle::~BlamerBundle ( )
inline

Definition at line 102 of file pageres.h.

102 { delete[] lattice_data; }
char * lattice_data
Definition: pageres.h:196
BlamerBundle::BlamerBundle ( const BlamerBundle other)
inline

Definition at line 142 of file pageres.h.

142  {
143  this->CopyTruth(other);
144  this->CopyResults(other);
145  }
void CopyTruth(const BlamerBundle &other)
Definition: pageres.h:117
void CopyResults(const BlamerBundle &other)
Definition: pageres.h:124

Member Function Documentation

void BlamerBundle::ClearResults ( )
inline

Definition at line 103 of file pageres.h.

103  {
105  norm_box_tolerance = 0;
107  debug = "";
113  delete[] lattice_data;
114  lattice_data = NULL;
115  lattice_size = 0;
116  }
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
GenericVector< int > correct_segmentation_cols
Definition: pageres.h:190
virtual void clear()
bool best_choice_is_dict_and_top_choice
Definition: pageres.h:194
int lattice_size
Definition: pageres.h:197
float best_correctly_segmented_rating
Definition: pageres.h:187
#define NULL
Definition: host.h:144
bool NoTruth() const
Definition: pageres.h:147
void DeleteAllBoxes()
Definition: boxword.cpp:213
tesseract::BoxWord norm_truth_word
Definition: pageres.h:170
static const float kBadRating
Definition: ratngs.h:188
STRING debug
Definition: pageres.h:178
bool segsearch_is_looking_for_blame
Definition: pageres.h:184
char * lattice_data
Definition: pageres.h:196
GenericVector< int > correct_segmentation_rows
Definition: pageres.h:191
int norm_box_tolerance
Definition: pageres.h:172
void BlamerBundle::CopyResults ( const BlamerBundle other)
inline

Definition at line 124 of file pageres.h.

124  {
134  if (other.lattice_data != NULL) {
135  lattice_data = new char[other.lattice_size];
136  memcpy(lattice_data, other.lattice_data, other.lattice_size);
137  lattice_size = other.lattice_size;
138  } else {
139  lattice_data = NULL;
140  }
141  }
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
GenericVector< int > correct_segmentation_cols
Definition: pageres.h:190
bool best_choice_is_dict_and_top_choice
Definition: pageres.h:194
int lattice_size
Definition: pageres.h:197
float best_correctly_segmented_rating
Definition: pageres.h:187
#define NULL
Definition: host.h:144
tesseract::BoxWord norm_truth_word
Definition: pageres.h:170
bool segsearch_is_looking_for_blame
Definition: pageres.h:184
char * lattice_data
Definition: pageres.h:196
GenericVector< int > correct_segmentation_rows
Definition: pageres.h:191
int norm_box_tolerance
Definition: pageres.h:172
void BlamerBundle::CopyTruth ( const BlamerBundle other)
inline

Definition at line 117 of file pageres.h.

117  {
119  truth_word = other.truth_word;
120  truth_text = other.truth_text;
122  (other.NoTruth() ? other.incorrect_result_reason : IRR_CORRECT);
123  }
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
bool NoTruth() const
Definition: pageres.h:147
tesseract::BoxWord truth_word
Definition: pageres.h:167
GenericVector< STRING > truth_text
Definition: pageres.h:174
bool truth_has_char_boxes
Definition: pageres.h:164
void BlamerBundle::FillDebugString ( const STRING msg,
const WERD_CHOICE choice,
STRING debug 
)

Definition at line 63 of file pageres.cpp.

65  {
66  (*debug) += "Truth ";
67  for (int i = 0; i < this->truth_text.length(); ++i) {
68  (*debug) += this->truth_text[i];
69  }
70  if (!this->truth_has_char_boxes) (*debug) += " (no char boxes)";
71  if (choice != NULL) {
72  (*debug) += " Choice ";
73  STRING choice_str;
74  choice->string_and_lengths(&choice_str, NULL);
75  (*debug) += choice_str;
76  }
77  if (msg.length() > 0) {
78  (*debug) += "\n";
79  (*debug) += msg;
80  }
81  (*debug) += "\n";
82 }
inT32 length() const
Definition: strngs.cpp:151
#define NULL
Definition: host.h:144
GenericVector< STRING > truth_text
Definition: pageres.h:174
Definition: strngs.h:40
int length() const
Definition: genericvector.h:63
bool truth_has_char_boxes
Definition: pageres.h:164
void string_and_lengths(STRING *word_str, STRING *word_lengths_str) const
Definition: ratngs.cpp:294
const char * BlamerBundle::IncorrectReason ( ) const

Definition at line 59 of file pageres.cpp.

59  {
61 }
const char *const kIncorrectResultReasonNames[]
Definition: pageres.cpp:40
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
const char * BlamerBundle::IncorrectReasonName ( IncorrectResultReason  irr)
static

Definition at line 55 of file pageres.cpp.

55  {
56  return kIncorrectResultReasonNames[irr];
57 }
const char *const kIncorrectResultReasonNames[]
Definition: pageres.cpp:40
bool BlamerBundle::NoTruth ( ) const
inline

Definition at line 147 of file pageres.h.

147  {
150  }
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
void BlamerBundle::SetBlame ( IncorrectResultReason  irr,
const STRING msg,
const WERD_CHOICE choice,
bool  debug 
)
inline

Definition at line 151 of file pageres.h.

152  {
153  this->incorrect_result_reason = irr;
154  this->debug = this->IncorrectReason();
155  this->debug += " to blame: ";
156  this->FillDebugString(msg, choice, &(this->debug));
157  if (debug) tprintf("SetBlame(): %s", this->debug.string());
158  }
const char * IncorrectReason() const
Definition: pageres.cpp:59
IncorrectResultReason incorrect_result_reason
Definition: pageres.h:176
void FillDebugString(const STRING &msg, const WERD_CHOICE *choice, STRING *debug)
Definition: pageres.cpp:63
const char * string() const
Definition: strngs.cpp:156
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:41
STRING debug
Definition: pageres.h:178

Member Data Documentation

bool BlamerBundle::best_choice_is_dict_and_top_choice

Definition at line 194 of file pageres.h.

float BlamerBundle::best_correctly_segmented_rating

Definition at line 187 of file pageres.h.

GenericVector<int> BlamerBundle::correct_segmentation_cols

Definition at line 190 of file pageres.h.

GenericVector<int> BlamerBundle::correct_segmentation_rows

Definition at line 191 of file pageres.h.

STRING BlamerBundle::debug

Definition at line 178 of file pageres.h.

IncorrectResultReason BlamerBundle::incorrect_result_reason

Definition at line 176 of file pageres.h.

char* BlamerBundle::lattice_data

Definition at line 196 of file pageres.h.

int BlamerBundle::lattice_size

Definition at line 197 of file pageres.h.

STRING BlamerBundle::misadaption_debug

Definition at line 180 of file pageres.h.

int BlamerBundle::norm_box_tolerance

Definition at line 172 of file pageres.h.

tesseract::BoxWord BlamerBundle::norm_truth_word

Definition at line 170 of file pageres.h.

tesseract::ParamsTrainingBundle BlamerBundle::params_training_bundle

Definition at line 199 of file pageres.h.

bool BlamerBundle::segsearch_is_looking_for_blame

Definition at line 184 of file pageres.h.

bool BlamerBundle::truth_has_char_boxes

Definition at line 164 of file pageres.h.

GenericVector<STRING> BlamerBundle::truth_text

Definition at line 174 of file pageres.h.

tesseract::BoxWord BlamerBundle::truth_word

Definition at line 167 of file pageres.h.


The documentation for this struct was generated from the following files: