894 BOOL8 prev_fuzzy_non;
902 C_OUTLINE_IT cout_it;
904 C_BLOB_IT cblob_it = &cblobs;
910 float repetition_spacing;
925 inT16 word_count = 0;
927 rep_char_it.set_to_list (&(row->
rep_words));
928 if (!rep_char_it.empty ()) {
929 next_rep_char_word_right =
930 rep_char_it.data ()->bounding_box ().right ();
934 cblob_it.set_to_list (&cblobs);
936 word_it.set_to_list (&words);
939 prev_fuzzy_sp =
FALSE;
940 prev_fuzzy_non =
FALSE;
941 if (!box_it.empty ()) {
942 xstarts[0] = box_it.data ()->bounding_box ().left ();
943 if (xstarts[0] > next_rep_char_word_right) {
945 word = rep_char_it.extract ();
946 word_it.add_after_then_move (word);
956 repetition_spacing = find_mean_blob_spacing (word);
957 current_gap = box_it.data ()->bounding_box ().left () -
958 next_rep_char_word_right;
959 current_within_xht_gap = current_gap;
968 tprintf (
"Repch wd at BOL(%d, %d). rep spacing %5.2f; Rgap:%d ",
969 box_it.data ()->bounding_box ().left (),
970 box_it.data ()->bounding_box ().bottom (),
971 repetition_spacing, current_gap);
972 prev_fuzzy_sp =
FALSE;
973 prev_fuzzy_non =
FALSE;
974 if (rep_char_it.empty ()) {
978 rep_char_it.forward ();
979 next_rep_char_word_right =
980 rep_char_it.data ()->bounding_box ().right ();
984 peek_at_next_gap(row,
988 next_within_xht_gap);
990 bblob = box_it.data ();
994 cout_it.set_to_list (cblob_it.data ()->out_list ());
995 cout_it.move_to_last ();
997 delete bblob->
cblob ();
1001 cblob_it.add_after_then_move (bblob->
cblob ());
1002 prev_x = blob_box.
right ();
1005 bblob = box_it.data ();
1010 prev_gap = current_gap;
1011 prev_within_xht_gap = current_within_xht_gap;
1012 prev_blob_box = next_blob_box;
1013 current_gap = next_gap;
1014 current_within_xht_gap = next_within_xht_gap;
1015 peek_at_next_gap(row,
1019 next_within_xht_gap);
1021 inT16 prev_gap_arg = prev_gap;
1022 inT16 next_gap_arg = next_gap;
1024 prev_gap_arg = prev_within_xht_gap;
1025 next_gap_arg = next_within_xht_gap;
1028 if (blob_box.
left () > next_rep_char_word_right ||
1029 make_a_word_break(row, blob_box, prev_gap_arg, prev_blob_box,
1030 current_gap, current_within_xht_gap,
1031 next_blob_box, next_gap_arg,
1032 blanks, fuzzy_sp, fuzzy_non,
1033 prev_gap_was_a_space,
1034 break_at_next_gap) ||
1035 box_it.at_first()) {
1037 word =
new WERD (&cblobs, prev_blanks,
NULL);
1039 word_it.add_after_then_move (word);
1047 else if (prev_fuzzy_non)
1051 if (blob_box.
left () > next_rep_char_word_right) {
1053 word = rep_char_it.extract ();
1054 word_it.add_after_then_move (word);
1057 repetition_spacing = find_mean_blob_spacing (word);
1059 current_within_xht_gap = current_gap;
1070 (
"Repch wd (%d,%d) rep gap %5.2f; Lgap:%d (%d blanks);",
1073 repetition_spacing, current_gap, blanks);
1081 blob_box.
left () - next_rep_char_word_right;
1090 tprintf (
" Rgap:%d (%d blanks)\n",
1091 current_gap, blanks);
1095 if (rep_char_it.empty ()) {
1099 rep_char_it.forward ();
1100 next_rep_char_word_right =
1101 rep_char_it.data ()->bounding_box ().right ();
1105 if (box_it.at_first () && rep_char_it.empty ()) {
1108 xstarts[1] = prev_x;
1111 prev_blanks = blanks;
1112 prev_fuzzy_sp = fuzzy_sp;
1113 prev_fuzzy_non = fuzzy_non;
1118 while (!box_it.at_first ());
1121 while (!rep_char_it.empty ()) {
1122 word = rep_char_it.extract ();
1123 word_it.add_after_then_move (word);
1126 repetition_spacing = find_mean_blob_spacing (word);
1137 (
"Repch wd at EOL (%d,%d). rep spacing %d; Lgap:%d (%d blanks)\n",
1139 repetition_spacing, current_gap, blanks);
1145 if (rep_char_it.empty ()) {
1148 xstarts[1] = prev_x;
1151 rep_char_it.forward ();
1155 coeffs[1] = row->
line_m ();
1156 coeffs[2] = row->
line_c ();
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",
void set_blanks(uinT8 new_blanks)
const TBOX & bounding_box() const
C_OUTLINE_LIST * out_list()
void recalc_bounding_box()
bool joined_to_prev() const
void set_flag(WERD_FLAGS mask, BOOL8 value)
DLLSYM void tprintf(const char *format,...)
TBOX bounding_box() const
bool tosp_only_use_xht_gaps
BLOBNBOX_LIST * blob_list()