892 BOOL8 prev_fuzzy_non;
894 BOOL8 fuzzy_sp =
false;
895 BOOL8 fuzzy_non =
false;
900 C_OUTLINE_IT cout_it;
902 C_BLOB_IT cblob_it = &cblobs;
908 float repetition_spacing;
922 inT16 word_count = 0;
924 rep_char_it.set_to_list (&(row->
rep_words));
925 if (!rep_char_it.empty ()) {
926 next_rep_char_word_right =
927 rep_char_it.data ()->bounding_box ().right ();
931 cblob_it.set_to_list (&cblobs);
933 word_it.set_to_list (&words);
936 prev_fuzzy_sp =
FALSE;
937 prev_fuzzy_non =
FALSE;
938 if (!box_it.empty ()) {
939 xstarts[0] = box_it.data ()->bounding_box ().left ();
940 if (xstarts[0] > next_rep_char_word_right) {
942 word = rep_char_it.extract ();
943 word_it.add_after_then_move (word);
953 repetition_spacing = find_mean_blob_spacing (word);
954 current_gap = box_it.data ()->bounding_box ().left () -
955 next_rep_char_word_right;
956 current_within_xht_gap = current_gap;
965 tprintf (
"Repch wd at BOL(%d, %d). rep spacing %5.2f; Rgap:%d ",
966 box_it.data ()->bounding_box ().left (),
967 box_it.data ()->bounding_box ().bottom (),
968 repetition_spacing, current_gap);
969 prev_fuzzy_sp =
FALSE;
970 prev_fuzzy_non =
FALSE;
971 if (rep_char_it.empty ()) {
975 rep_char_it.forward ();
976 next_rep_char_word_right =
977 rep_char_it.data ()->bounding_box ().right ();
981 peek_at_next_gap(row,
985 next_within_xht_gap);
987 bblob = box_it.data ();
991 cout_it.set_to_list (cblob_it.data ()->out_list ());
992 cout_it.move_to_last ();
994 delete bblob->
cblob ();
998 cblob_it.add_after_then_move (bblob->
cblob ());
999 prev_x = blob_box.
right ();
1002 bblob = box_it.data ();
1007 prev_gap = current_gap;
1008 prev_within_xht_gap = current_within_xht_gap;
1009 prev_blob_box = next_blob_box;
1010 current_gap = next_gap;
1011 current_within_xht_gap = next_within_xht_gap;
1012 peek_at_next_gap(row,
1016 next_within_xht_gap);
1018 inT16 prev_gap_arg = prev_gap;
1019 inT16 next_gap_arg = next_gap;
1021 prev_gap_arg = prev_within_xht_gap;
1022 next_gap_arg = next_within_xht_gap;
1025 if (blob_box.
left () > next_rep_char_word_right ||
1026 make_a_word_break(row, blob_box, prev_gap_arg, prev_blob_box,
1027 current_gap, current_within_xht_gap,
1028 next_blob_box, next_gap_arg,
1029 blanks, fuzzy_sp, fuzzy_non,
1030 prev_gap_was_a_space,
1031 break_at_next_gap) ||
1032 box_it.at_first()) {
1034 word =
new WERD (&cblobs, prev_blanks,
NULL);
1036 word_it.add_after_then_move (word);
1044 else if (prev_fuzzy_non)
1048 if (blob_box.
left () > next_rep_char_word_right) {
1050 word = rep_char_it.extract ();
1051 word_it.add_after_then_move (word);
1054 repetition_spacing = find_mean_blob_spacing (word);
1056 current_within_xht_gap = current_gap;
1067 (
"Repch wd (%d,%d) rep gap %5.2f; Lgap:%d (%d blanks);",
1070 repetition_spacing, current_gap, blanks);
1078 blob_box.
left () - next_rep_char_word_right;
1087 tprintf (
" Rgap:%d (%d blanks)\n",
1088 current_gap, blanks);
1092 if (rep_char_it.empty ()) {
1096 rep_char_it.forward ();
1097 next_rep_char_word_right =
1098 rep_char_it.data ()->bounding_box ().right ();
1102 if (box_it.at_first () && rep_char_it.empty ()) {
1105 xstarts[1] = prev_x;
1108 prev_blanks = blanks;
1109 prev_fuzzy_sp = fuzzy_sp;
1110 prev_fuzzy_non = fuzzy_non;
1115 while (!box_it.at_first ());
1118 while (!rep_char_it.empty ()) {
1119 word = rep_char_it.extract ();
1120 word_it.add_after_then_move (word);
1123 repetition_spacing = find_mean_blob_spacing (word);
1134 (
"Repch wd at EOL (%d,%d). rep spacing %d; Lgap:%d (%d blanks)\n",
1136 repetition_spacing, current_gap, blanks);
1142 if (rep_char_it.empty ()) {
1145 xstarts[1] = prev_x;
1148 rep_char_it.forward ();
1151 real_row =
new ROW (row,
1153 word_it.set_to_list (real_row->
word_list ());
1155 word_it.add_list_after (&words);
1159 tprintf (
"Row: Made %d words in row ((%d,%d)(%d,%d))\n",
bool tosp_only_use_xht_gaps
bool joined_to_prev() const
TBOX bounding_box() const
BLOBNBOX_LIST * blob_list()
C_OUTLINE_LIST * out_list()
TBOX bounding_box() const
const TBOX & bounding_box() const
void set_flag(WERD_FLAGS mask, BOOL8 value)
void set_blanks(uinT8 new_blanks)
void recalc_bounding_box()