00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OUTPUT_H
00021 #define OUTPUT_H
00022
00023 #include "varable.h"
00024
00025 #include "pageres.h"
00026 #include "notdll.h"
00027
00028 extern BOOL_EVAR_H (tessedit_write_block_separators, TRUE,
00029 "Write block separators in output");
00030 extern BOOL_VAR_H (tessedit_write_raw_output, FALSE,
00031 "Write raw stuff to name.raw");
00032 extern BOOL_EVAR_H (tessedit_write_output, TRUE, "Write text to name.txt");
00033 extern BOOL_EVAR_H (tessedit_write_txt_map, TRUE,
00034 "Write .txt to .etx map file");
00035 extern BOOL_EVAR_H (tessedit_write_rep_codes, TRUE,
00036 "Write repetition char code");
00037 extern BOOL_EVAR_H (tessedit_write_unlv, FALSE, "Write .unlv output file");
00038 extern STRING_EVAR_H (unrecognised_char, "|",
00039 "Output char for unidentified blobs");
00040 extern INT_EVAR_H (suspect_level, 99, "Suspect marker level");
00041 extern INT_VAR_H (suspect_space_level, 100,
00042 "Min suspect level for rejecting spaces");
00043 extern INT_VAR_H (suspect_short_words, 2,
00044 "Dont Suspect dict wds longer than this");
00045 extern BOOL_VAR_H (suspect_constrain_1Il, FALSE,
00046 "UNLV keep 1Il chars rejected");
00047 extern double_VAR_H (suspect_rating_per_ch, 999.9,
00048 "Dont touch bad rating limit");
00049 extern double_VAR_H (suspect_accept_rating, -999.9,
00050 "Accept good rating limit");
00051 extern BOOL_EVAR_H (tessedit_minimal_rejection, FALSE,
00052 "Only reject tess failures");
00053 extern BOOL_VAR_H (tessedit_zero_rejection, FALSE, "Dont reject ANYTHING");
00054 extern BOOL_VAR_H (tessedit_word_for_word, FALSE,
00055 "Make output have exactly one word per WERD");
00056 extern BOOL_VAR_H (tessedit_consistent_reps, TRUE,
00057 "Force all rep chars the same");
00058
00060 void write_results(
00061 PAGE_RES_IT &page_res_it,
00062 char newline_type,
00063 BOOL8 force_eol,
00064 BOOL8 write_to_shm
00065 );
00066
00068 WERD_CHOICE *make_epaper_choice(
00069 WERD_RES *word,
00070 char newline_type
00071 );
00073 inT16 make_reject (
00074 TBOX * inset_box,
00075 inT16 prevright,
00076 inT16 nextleft,
00077 DENORM * denorm,
00078 char word_string[]
00079 );
00080
00082 char determine_newline_type(
00083 WERD *word,
00084 BLOCK *block,
00085 WERD *next_word,
00086 BLOCK *next_block
00087 );
00089 void write_cooked_text(
00090 WERD *word,
00091 const STRING &text,
00092 BOOL8 acceptable,
00093 BOOL8 pass2,
00094 FILE *fp
00095 );
00097 void write_shm_text(
00098 WERD_RES *word,
00099 BLOCK *block,
00100 ROW_RES *row,
00101 const STRING &text,
00102 const STRING &text_lengths
00103 );
00105 void write_map(
00106 FILE *mapfile,
00107 WERD_RES *word);
00108
00109
00110 void write_unlv_text(WERD_RES *word);
00111 void ensure_rep_chars_are_consistent(WERD_RES *word);
00112 #endif