23 #include "config_auto.h"
49 for (
int r = 0; r < num_shape_results; ++r) {
52 return results->
size();
59 int debug,
int keep_this,
61 ASSERT_HOST(
"Must implement ClassifySample!" ==
nullptr);
75 for (
int r = 0; r < num_results; ++r) {
77 if (result !=
nullptr)
79 return results[r].shape_id;
99 #ifndef GRAPHICS_DISABLED
101 if (terminator ==
nullptr) {
102 terminator =
new ScrollView(
"XIT", 0, 0, 50, 50, 50, 50,
true);
107 popup_menu->AddChild(
"Choose class to debug", 0,
"x",
"Class to debug");
108 popup_menu->BuildMenu(debug_win,
false);
111 uint32_t num_features =
sample.num_features();
112 for (uint32_t f = 0; f < num_features; ++f) {
123 if (unichar_id >= 0) {
124 tprintf(
"Debugging class %d = %s\n",
129 tprintf(
"Invalid unichar_id: %d\n", unichar_id);
132 if (unichar_id >= 0) {
133 tprintf(
"Debugged class %d = %s\n",
136 tprintf(
"Right-click in ClassifierDebug window to choose debug class,");
137 tprintf(
" Left-click or close window to quit...\n");
140 old_unichar_id = unichar_id;
151 }
while (unichar_id == old_unichar_id &&
155 #endif // GRAPHICS_DISABLED
175 for (
int i = 0; i < results.
size(); ++i) {
176 tprintf(
"%g: c_id=%d=%s", results[i].rating, results[i].unichar_id,
178 if (!results[i].fonts.
empty()) {
180 for (
int f = 0; f < results[i].fonts.
size(); ++f) {
181 tprintf(
" %d", results[i].fonts[f].fontinfo_id);
190 for (
int i = 0; i < results.
size(); ++i) {
191 tprintf(
"%g:", results[i].rating);
192 if (results[i].joined)
194 if (results[i].broken)
207 for (
int r = 0; r < results->
size(); ++r) {
209 const Shape& shape_r = shapes->
GetShape((*results)[r].shape_id);
211 for (c = 0; c < shape_r.
size(); ++c) {
212 int unichar_id = shape_r[c].unichar_id;
214 for (s = 0; s < r; ++s) {
215 const Shape& shape_s = shapes->
GetShape((*results)[s].shape_id);
222 if (c == shape_r.
size())
225 filtered_results.
push_back((*results)[r]);
227 *results = filtered_results;