898 BOOL8 prev_fuzzy_non;
900 BOOL8 fuzzy_sp =
false;
901 BOOL8 fuzzy_non =
false;
906 C_OUTLINE_IT cout_it;
908 C_BLOB_IT cblob_it = &cblobs;
914 float repetition_spacing;
928 inT16 word_count = 0;
930 rep_char_it.set_to_list (&(row->
rep_words));
931 if (!rep_char_it.empty ()) {
932 next_rep_char_word_right =
933 rep_char_it.data ()->bounding_box ().right ();
937 cblob_it.set_to_list (&cblobs);
939 word_it.set_to_list (&words);
942 prev_fuzzy_sp =
FALSE;
943 prev_fuzzy_non =
FALSE;
944 if (!box_it.empty ()) {
945 xstarts[0] = box_it.data ()->bounding_box ().left ();
946 if (xstarts[0] > next_rep_char_word_right) {
948 word = rep_char_it.extract ();
949 word_it.add_after_then_move (word);
959 repetition_spacing = find_mean_blob_spacing (word);
960 current_gap = box_it.data ()->bounding_box ().left () -
961 next_rep_char_word_right;
962 current_within_xht_gap = current_gap;
971 tprintf (
"Repch wd at BOL(%d, %d). rep spacing %5.2f; Rgap:%d ",
972 box_it.data ()->bounding_box ().left (),
973 box_it.data ()->bounding_box ().bottom (),
974 repetition_spacing, current_gap);
975 prev_fuzzy_sp =
FALSE;
976 prev_fuzzy_non =
FALSE;
977 if (rep_char_it.empty ()) {
981 rep_char_it.forward ();
982 next_rep_char_word_right =
983 rep_char_it.data ()->bounding_box ().right ();
987 peek_at_next_gap(row,
991 next_within_xht_gap);
993 bblob = box_it.data ();
996 if (bblob->
cblob () != NULL) {
997 cout_it.set_to_list (cblob_it.data ()->out_list ());
998 cout_it.move_to_last ();
1000 delete bblob->
cblob ();
1003 if (bblob->
cblob() != NULL)
1004 cblob_it.add_after_then_move (bblob->
cblob ());
1005 prev_x = blob_box.
right ();
1008 bblob = box_it.data ();
1013 prev_gap = current_gap;
1014 prev_within_xht_gap = current_within_xht_gap;
1015 prev_blob_box = next_blob_box;
1016 current_gap = next_gap;
1017 current_within_xht_gap = next_within_xht_gap;
1018 peek_at_next_gap(row,
1022 next_within_xht_gap);
1024 inT16 prev_gap_arg = prev_gap;
1025 inT16 next_gap_arg = next_gap;
1027 prev_gap_arg = prev_within_xht_gap;
1028 next_gap_arg = next_within_xht_gap;
1031 if (blob_box.
left () > next_rep_char_word_right ||
1032 make_a_word_break(row, blob_box, prev_gap_arg, prev_blob_box,
1033 current_gap, current_within_xht_gap,
1034 next_blob_box, next_gap_arg,
1035 blanks, fuzzy_sp, fuzzy_non,
1036 prev_gap_was_a_space,
1037 break_at_next_gap) ||
1038 box_it.at_first()) {
1040 word =
new WERD (&cblobs, prev_blanks, NULL);
1042 word_it.add_after_then_move (word);
1050 else if (prev_fuzzy_non)
1054 if (blob_box.
left () > next_rep_char_word_right) {
1056 word = rep_char_it.extract ();
1057 word_it.add_after_then_move (word);
1060 repetition_spacing = find_mean_blob_spacing (word);
1062 current_within_xht_gap = current_gap;
1073 (
"Repch wd (%d,%d) rep gap %5.2f; Lgap:%d (%d blanks);",
1076 repetition_spacing, current_gap, blanks);
1084 blob_box.
left () - next_rep_char_word_right;
1093 tprintf (
" Rgap:%d (%d blanks)\n",
1094 current_gap, blanks);
1098 if (rep_char_it.empty ()) {
1102 rep_char_it.forward ();
1103 next_rep_char_word_right =
1104 rep_char_it.data ()->bounding_box ().right ();
1108 if (box_it.at_first () && rep_char_it.empty ()) {
1111 xstarts[1] = prev_x;
1114 prev_blanks = blanks;
1115 prev_fuzzy_sp = fuzzy_sp;
1116 prev_fuzzy_non = fuzzy_non;
1121 while (!box_it.at_first ());
1124 while (!rep_char_it.empty ()) {
1125 word = rep_char_it.extract ();
1126 word_it.add_after_then_move (word);
1129 repetition_spacing = find_mean_blob_spacing (word);
1140 "Repch wd at EOL (%d,%d). rep spacing %5.2f; Lgap:%d (%d blanks)\n",
1142 repetition_spacing, current_gap, blanks);
1148 if (rep_char_it.empty ()) {
1151 xstarts[1] = prev_x;
1154 rep_char_it.forward ();
1157 real_row =
new ROW (row,
1159 word_it.set_to_list (real_row->
word_list ());
1161 word_it.add_list_after (&words);
1165 tprintf (
"Row: Made %d words in row ((%d,%d)(%d,%d))\n",
const TBOX & bounding_box() const
TBOX bounding_box() const
void set_blanks(uinT8 new_blanks)
C_OUTLINE_LIST * out_list()
void recalc_bounding_box()
BLOBNBOX_LIST * blob_list()
bool joined_to_prev() const
void set_flag(WERD_FLAGS mask, BOOL8 value)
bool tosp_only_use_xht_gaps
TBOX bounding_box() const