21 #ifndef TESSERACT_CCSTRUCT_BLAMER_H_
22 #define TESSERACT_CCSTRUCT_BLAMER_H_
28 #ifndef DISABLED_LEGACY_ENGINE
30 #endif // ndef DISABLED_LEGACY_ENGINE
47 static const int16_t kBlamerBoxTolerance = 5;
116 for (
int i = 0; i < truth_text_.
length(); ++i)
117 truth_str += truth_text_[i];
121 return incorrect_result_reason_;
128 return debug_.
length() > 0 || misadaption_debug_.
length() > 0;
134 return misadaption_debug_;
137 if (rating < best_correctly_segmented_rating_)
138 best_correctly_segmented_rating_ = rating;
141 return correct_segmentation_cols_.
length();
146 return correct_segmentation_cols_[index] == coord.
col &&
147 correct_segmentation_rows_[index] == coord.
row;
150 best_choice_is_dict_and_top_choice_ = value;
153 return lattice_data_;
156 return lattice_size_;
159 lattice_size_ = size;
160 delete [] lattice_data_;
161 lattice_data_ =
new char[lattice_size_];
162 memcpy(lattice_data_, data, lattice_size_);
164 #ifndef DISABLED_LEGACY_ENGINE
166 return params_training_bundle_;
172 #endif // ndef DISABLED_LEGACY_ENGINE
177 const char* truth_str,
const TBOX& word_box);
181 const char* char_str,
const TBOX& char_box);
191 norm_box_tolerance_ = 0;
194 segsearch_is_looking_for_blame_ =
false;
196 correct_segmentation_cols_.
clear();
197 correct_segmentation_rows_.
clear();
198 best_choice_is_dict_and_top_choice_ =
false;
199 delete[] lattice_data_;
200 lattice_data_ =
nullptr;
204 truth_has_char_boxes_ = other.truth_has_char_boxes_;
205 truth_word_ = other.truth_word_;
206 truth_text_ = other.truth_text_;
207 incorrect_result_reason_ =
211 norm_truth_word_ = other.norm_truth_word_;
212 norm_box_tolerance_ = other.norm_box_tolerance_;
213 incorrect_result_reason_ = other.incorrect_result_reason_;
214 segsearch_is_looking_for_blame_ = other.segsearch_is_looking_for_blame_;
215 best_correctly_segmented_rating_ = other.best_correctly_segmented_rating_;
216 correct_segmentation_cols_ = other.correct_segmentation_cols_;
217 correct_segmentation_rows_ = other.correct_segmentation_rows_;
218 best_choice_is_dict_and_top_choice_ =
219 other.best_choice_is_dict_and_top_choice_;
220 if (other.lattice_data_ !=
nullptr) {
221 lattice_data_ =
new char[other.lattice_size_];
222 memcpy(lattice_data_, other.lattice_data_, other.lattice_size_);
223 lattice_size_ = other.lattice_size_;
225 lattice_data_ =
nullptr;
250 const TBOX& blob_box,
251 const BLOB_CHOICE_LIST& choices,
300 incorrect_result_reason_ = irr;
302 debug_ +=
" to blame: ";
309 bool truth_has_char_boxes_;
317 int norm_box_tolerance_;
325 STRING misadaption_debug_;
329 bool segsearch_is_looking_for_blame_;
332 float best_correctly_segmented_rating_;
339 bool best_choice_is_dict_and_top_choice_;
344 #ifndef DISABLED_LEGACY_ENGINE
346 #endif // ndef DISABLED_LEGACY_ENGINE
350 #endif // TESSERACT_CCSTRUCT_BLAMER_H_