149 ExtractBestPaths(&best_nodes, &second_nodes);
151 DebugPath(unicharset, best_nodes);
152 ExtractPathAsUnicharIds(second_nodes, &unichar_ids, &certs, &ratings,
154 tprintf(
"\nSecond choice path:\n");
155 DebugUnicharPath(unicharset, second_nodes, unichar_ids, certs, ratings,
158 ExtractPathAsUnicharIds(best_nodes, &unichar_ids, &certs, &ratings, &xcoords);
159 int num_ids = unichar_ids.
size();
161 DebugUnicharPath(unicharset, best_nodes, unichar_ids, certs, ratings,
166 float prev_space_cert = 0.0f;
167 for (
int word_start = 0; word_start < num_ids; word_start = word_end) {
168 for (word_end = word_start + 1; word_end < num_ids; ++word_end) {
173 int index = xcoords[word_end];
174 if (best_nodes[index]->start_of_word)
break;
180 float space_cert = 0.0f;
181 if (word_end < num_ids && unichar_ids[word_end] ==
UNICHAR_SPACE)
182 space_cert = certs[word_end];
184 word_start > 0 && unichar_ids[word_start - 1] ==
UNICHAR_SPACE;
186 WERD_RES* word_res = InitializeWord(
187 leading_space, line_box, word_start, word_end,
188 MIN(space_cert, prev_space_cert), unicharset, xcoords, scale_factor);
189 for (
int i = word_start; i < word_end; ++i) {
190 BLOB_CHOICE_LIST* choices =
new BLOB_CHOICE_LIST;
191 BLOB_CHOICE_IT bc_it(choices);
193 unichar_ids[i], ratings[i], certs[i], -1, 1.0f,
195 int col = i - word_start;
197 bc_it.add_after_then_move(choice);
200 int index = xcoords[word_end - 1];
203 prev_space_cert = space_cert;
204 if (word_end < num_ids && unichar_ids[word_end] ==
UNICHAR_SPACE)
void put(ICOORD pos, const T &thing)
void FakeWordFromRatings(PermuterType permuter)
bool IsSpaceDelimited(UNICHAR_ID unichar_id) const
void set_matrix_cell(int col, int row)