36 : cube_cntxt_(tesseract->GetCubeRecoContext()),
37 shape_table_(*tesseract->shape_table()) {
45 Pix* page_pix,
int debug,
int keep_this,
48 if (page_pix ==
NULL)
return 0;
53 cube_cntxt_, page_pix, char_box.
left(),
54 pixGetHeight(page_pix) - char_box.
top(),
59 if (alt_list !=
NULL) {
60 for (
int i = 0; i < alt_list->AltCount(); ++i) {
62 int alt_id = alt_list->Alt(i);
64 int shape_id = shape_table_.
FindShape(unichar_id, -1);
71 return results->
size();
80 : cube_cntxt_(tesseract->GetCubeRecoContext()),
81 shape_table_(*tesseract->shape_table()),
91 Pix* page_pix,
int debug,
int keep_this,
93 int num_results = pruner_->
ClassifySample(sample, page_pix, debug, keep_this,
95 if (page_pix ==
NULL)
return num_results;
100 cube_cntxt_, page_pix, char_box.
left(),
101 pixGetHeight(page_pix) - char_box.
top(),
105 if (alt_list !=
NULL) {
106 for (
int r = 0; r < num_results; ++r) {
107 const Shape& shape = shape_table_.
GetShape((*results)[r].shape_id);
109 double best_prob = 0.0;
110 for (
int i = 0; i < alt_list->AltCount(); ++i) {
111 int alt_id = alt_list->Alt(i);
114 alt_list->AltProb(i) > best_prob) {
115 best_prob = alt_list->AltProb(i);
118 (*results)[r].rating = best_prob;
125 return results->
size();
130 return &shape_table_;