{
C_OUTLINE_IT cout_it;
C_BLOB_LIST cblobs;
C_BLOB_IT cblob_it = &cblobs;
WERD_LIST words;
WERD_IT word_it;
WERD_IT rep_char_it;
float repetition_spacing;
double coeffs[3];
BLOBNBOX_IT box_it;
if (!rep_char_it.empty ()) {
next_rep_char_word_right =
rep_char_it.data ()->bounding_box ().right ();
}
cblob_it.set_to_list (&cblobs);
word_it.set_to_list (&words);
prev_blanks = 0;
if (!box_it.empty ()) {
xstarts[0] = box_it.data ()->bounding_box ().left ();
if (xstarts[0] > next_rep_char_word_right) {
word = rep_char_it.extract ();
word_it.add_after_then_move (word);
repetition_spacing = find_mean_blob_spacing (word);
current_gap = box_it.data ()->bounding_box ().left () -
next_rep_char_word_right;
current_within_xht_gap = current_gap;
if (prev_blanks < 1)
prev_blanks = 1;
}
else
prev_blanks = 0;
tprintf (
"Repch wd at BOL(%d, %d). rep spacing %5.2f; Rgap:%d ",
box_it.data ()->bounding_box ().left (),
box_it.data ()->bounding_box ().bottom (),
repetition_spacing, current_gap);
if (rep_char_it.empty ()) {
}
else {
rep_char_it.forward ();
next_rep_char_word_right =
rep_char_it.data ()->bounding_box ().right ();
}
}
peek_at_next_gap(row,
box_it,
next_blob_box,
next_gap,
next_within_xht_gap);
do {
bblob = box_it.data ();
cout_it.set_to_list (cblob_it.data ()->out_list ());
cout_it.move_to_last ();
}
} else {
cblob_it.add_after_then_move (bblob->
cblob ());
prev_x = blob_box.
right ();
}
box_it.forward ();
bblob = box_it.data ();
prev_gap = current_gap;
prev_within_xht_gap = current_within_xht_gap;
prev_blob_box = next_blob_box;
current_gap = next_gap;
current_within_xht_gap = next_within_xht_gap;
peek_at_next_gap(row,
box_it,
next_blob_box,
next_gap,
next_within_xht_gap);
inT16 prev_gap_arg = prev_gap;
inT16 next_gap_arg = next_gap;
prev_gap_arg = prev_within_xht_gap;
next_gap_arg = next_within_xht_gap;
}
if (blob_box.
left () > next_rep_char_word_right ||
make_a_word_break(row, blob_box, prev_gap_arg, prev_blob_box,
current_gap, current_within_xht_gap,
next_blob_box, next_gap_arg,
blanks, fuzzy_sp, fuzzy_non,
prev_gap_was_a_space,
break_at_next_gap) ||
box_it.at_first()) {
word =
new WERD (&cblobs, prev_blanks,
NULL);
word_count++;
word_it.add_after_then_move (word);
if (bol) {
}
if (prev_fuzzy_sp)
else if (prev_fuzzy_non)
if (blob_box.
left () > next_rep_char_word_right) {
word = rep_char_it.extract ();
word_it.add_after_then_move (word);
repetition_spacing = find_mean_blob_spacing (word);
current_within_xht_gap = current_gap;
blanks =
if (blanks < 1)
blanks = 1;
}
else
blanks = 0;
("Repch wd (%d,%d) rep gap %5.2f; Lgap:%d (%d blanks);",
repetition_spacing, current_gap, blanks);
current_gap =
blob_box.
left () - next_rep_char_word_right;
if (blanks < 1)
blanks = 1;
}
else
blanks = 0;
current_gap, blanks);
if (rep_char_it.empty ()) {
}
else {
rep_char_it.forward ();
next_rep_char_word_right =
rep_char_it.data ()->bounding_box ().right ();
}
}
if (box_it.at_first () && rep_char_it.empty ()) {
xstarts[1] = prev_x;
}
else {
prev_blanks = blanks;
prev_fuzzy_sp = fuzzy_sp;
prev_fuzzy_non = fuzzy_non;
}
}
}
}
while (!box_it.at_first ());
while (!rep_char_it.empty ()) {
word = rep_char_it.extract ();
word_it.add_after_then_move (word);
repetition_spacing = find_mean_blob_spacing (word);
if (blanks < 1)
blanks = 1;
}
else
blanks = 0;
("Repch wd at EOL (%d,%d). rep spacing %d; Lgap:%d (%d blanks)\n",
repetition_spacing, current_gap, blanks);
if (rep_char_it.empty ()) {
xstarts[1] = prev_x;
}
else {
rep_char_it.forward ();
}
}
coeffs[0] = 0;
word_it.set_to_list (real_row->
word_list ());
word_it.add_list_after (&words);
tprintf (
"Row: Made %d words in row ((%d,%d)(%d,%d))\n",
word_count,
}
return real_row;
}
}