00001
00021 #ifndef FIXSPACE_H
00022 #define FIXSPACE_H
00023
00024 #include "pageres.h"
00025 #include "varable.h"
00026 #include "ocrclass.h"
00027 #include "notdll.h"
00028
00031 extern BOOL_VAR_H (fixsp_check_for_fp_noise_space, TRUE,
00032 "Try turning noise to space in fixed pitch");
00033 extern BOOL_VAR_H (fixsp_fp_eval, TRUE, "Use alternate evaluation for fp");
00034 extern BOOL_VAR_H (fixsp_noise_score_fixing, TRUE, "More sophisticated?");
00035 extern INT_VAR_H (fixsp_non_noise_limit, 1,
00036 "How many non-noise blbs either side?");
00037 extern double_VAR_H (fixsp_small_outlines_size, 0.28,
00038 "Small if lt xht x this");
00039 extern BOOL_VAR_H (fixsp_ignore_punct, TRUE, "In uniform spacing calc");
00040 extern BOOL_VAR_H (fixsp_numeric_fix, TRUE, "Try to deal with numeric punct");
00041 extern BOOL_VAR_H (fixsp_prefer_joined_1s, TRUE, "Arbitrary boost");
00042 extern BOOL_VAR_H (tessedit_test_uniform_wd_spacing, FALSE,
00043 "Limit context word spacing");
00044 extern BOOL_VAR_H (tessedit_prefer_joined_punct, FALSE,
00045 "Reward punctation joins");
00046 extern INT_VAR_H (fixsp_done_mode, 1, "What constitues done for spacing");
00047 extern INT_VAR_H (debug_fix_space_level, 0, "Contextual fixspace debug");
00048 extern STRING_VAR_H (numeric_punctuation, ".,",
00049 "Punct. chs expected WITHIN numbers");
00051 void fix_fuzzy_spaces(
00052 volatile ETEXT_DESC *monitor,
00053 INT32 word_count,
00054 PAGE_RES *page_res);
00055 void fix_fuzzy_space_list(
00056 WERD_RES_LIST &best_perm,
00057 ROW *row);
00058 void initialise_search(WERD_RES_LIST &src_list, WERD_RES_LIST &new_list);
00059 void match_current_words(WERD_RES_LIST &words, ROW *row);
00060 INT16 eval_word_spacing(WERD_RES_LIST &word_res_list);
00061 BOOL8 digit_or_numeric_punct(WERD_RES *word, char ch);
00062 void transform_to_next_perm(WERD_RES_LIST &words);
00063 void dump_words(WERD_RES_LIST &perm, INT16 score, INT16 mode, BOOL8 improved);
00064 BOOL8 uniformly_spaced(
00065 WERD_RES *word);
00066 BOOL8 fixspace_thinks_word_done(WERD_RES *word);
00067 void fix_sp_fp_word(WERD_RES_IT &word_res_it, ROW *row);
00068 void fix_noisy_space_list(WERD_RES_LIST &best_perm, ROW *row);
00069 void break_noisiest_blob_word(WERD_RES_LIST &words);
00070 INT16 worst_noise_blob(WERD_RES *word_res, float *worst_noise_score);
00071 float blob_noise_score(PBLOB *blob);
00072 void fixspace_dbg(WERD_RES *word);
00073 INT16 fp_eval_word_spacing(WERD_RES_LIST &word_res_list);
00074 #endif