24 #include "config_auto.h"
50 for (
int r = 0; r < num_shape_results; ++r) {
53 return results->
size();
60 int debug,
int keep_this,
62 ASSERT_HOST(
"Must implement ClassifySample!" ==
nullptr);
76 for (
int r = 0; r < num_results; ++r) {
78 if (result !=
nullptr)
80 return results[r].shape_id;
100 #ifndef GRAPHICS_DISABLED
102 if (terminator ==
nullptr) {
103 terminator =
new ScrollView(
"XIT", 0, 0, 50, 50, 50, 50,
true);
108 popup_menu->AddChild(
"Choose class to debug", 0,
"x",
"Class to debug");
109 popup_menu->BuildMenu(debug_win,
false);
112 uint32_t num_features =
sample.num_features();
113 for (uint32_t f = 0; f < num_features; ++f) {
124 if (unichar_id >= 0) {
125 tprintf(
"Debugging class %d = %s\n",
130 tprintf(
"Invalid unichar_id: %d\n", unichar_id);
133 if (unichar_id >= 0) {
134 tprintf(
"Debugged class %d = %s\n",
137 tprintf(
"Right-click in ClassifierDebug window to choose debug class,");
138 tprintf(
" Left-click or close window to quit...\n");
141 old_unichar_id = unichar_id;
152 }
while (unichar_id == old_unichar_id &&
156 #endif // GRAPHICS_DISABLED
176 for (
int i = 0; i < results.
size(); ++i) {
177 tprintf(
"%g: c_id=%d=%s", results[i].rating, results[i].unichar_id,
179 if (!results[i].fonts.
empty()) {
181 for (
int f = 0; f < results[i].fonts.
size(); ++f) {
182 tprintf(
" %d", results[i].fonts[f].fontinfo_id);
191 for (
int i = 0; i < results.
size(); ++i) {
192 tprintf(
"%g:", results[i].rating);
193 if (results[i].joined)
195 if (results[i].broken)
208 for (
int r = 0; r < results->
size(); ++r) {
210 const Shape& shape_r = shapes->
GetShape((*results)[r].shape_id);
212 for (c = 0; c < shape_r.
size(); ++c) {
213 int unichar_id = shape_r[c].unichar_id;
215 for (s = 0; s < r; ++s) {
216 const Shape& shape_s = shapes->
GetShape((*results)[s].shape_id);
223 if (c == shape_r.
size())
226 filtered_results.
push_back((*results)[r]);
228 *results = filtered_results;