tesseract  4.1.1
REJ Class Reference

#include <rejctmap.h>

Public Member Functions

 REJ ()=default
 
 REJ (const REJ &source)
 
REJoperator= (const REJ &source)
 
bool flag (REJ_FLAGS rej_flag)
 
char display_char ()
 
bool perm_rejected ()
 
bool rejected ()
 
bool accepted ()
 
bool accept_if_good_quality ()
 
bool recoverable ()
 
void setrej_tess_failure ()
 
void setrej_small_xht ()
 
void setrej_edge_char ()
 
void setrej_1Il_conflict ()
 
void setrej_postNN_1Il ()
 
void setrej_rej_cblob ()
 
void setrej_mm_reject ()
 
void setrej_bad_repetition ()
 
void setrej_poor_match ()
 
void setrej_not_tess_accepted ()
 
void setrej_contains_blanks ()
 
void setrej_bad_permuter ()
 
void setrej_hyphen ()
 
void setrej_dubious ()
 
void setrej_no_alphanums ()
 
void setrej_mostly_rej ()
 
void setrej_xht_fixup ()
 
void setrej_bad_quality ()
 
void setrej_doc_rej ()
 
void setrej_block_rej ()
 
void setrej_row_rej ()
 
void setrej_unlv_rej ()
 
void setrej_nn_accept ()
 
void setrej_hyphen_accept ()
 
void setrej_mm_accept ()
 
void setrej_quality_accept ()
 
void setrej_minimal_rej_accept ()
 
void full_print (FILE *fp)
 

Detailed Description

Definition at line 97 of file rejctmap.h.

Constructor & Destructor Documentation

◆ REJ() [1/2]

REJ::REJ ( )
default

◆ REJ() [2/2]

REJ::REJ ( const REJ source)
inline

Definition at line 119 of file rejctmap.h.

120  {
121  flags1 = source.flags1;
122  flags2 = source.flags2;
123  }

Member Function Documentation

◆ accept_if_good_quality()

bool REJ::accept_if_good_quality ( )

Definition at line 81 of file rejctmap.cpp.

81  { //potential rej?
82  return (rejected () &&
83  !perm_rejected () &&
84  flag (R_BAD_PERMUTER) &&
85  !flag (R_POOR_MATCH) &&
88  (!rej_between_nn_and_mm () &&
89  !rej_between_mm_and_quality_accept () &&
90  !rej_between_quality_and_minimal_rej_accept ()));
91 }
@ R_NOT_TESS_ACCEPTED
Definition: rejctmap.h:62
@ R_BAD_PERMUTER
Definition: rejctmap.h:64
@ R_CONTAINS_BLANKS
Definition: rejctmap.h:63
@ R_POOR_MATCH
Definition: rejctmap.h:61
bool rejected()
Definition: rejctmap.cpp:71
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:132
bool perm_rejected()
Definition: rejctmap.cpp:22

◆ accepted()

bool REJ::accepted ( )
inline

Definition at line 154 of file rejctmap.h.

154  { //Is char accepted?
155  return !rejected ();
156  }

◆ display_char()

char REJ::display_char ( )
inline

Definition at line 139 of file rejctmap.h.

139  {
140  if (perm_rejected ())
141  return MAP_REJECT_PERM;
142  else if (accept_if_good_quality ())
143  return MAP_REJECT_POTENTIAL;
144  else if (rejected ())
145  return MAP_REJECT_TEMP;
146  else
147  return MAP_ACCEPT;
148  }
#define MAP_ACCEPT
Definition: rejctmap.h:92
#define MAP_REJECT_POTENTIAL
Definition: rejctmap.h:95
#define MAP_REJECT_PERM
Definition: rejctmap.h:93
#define MAP_REJECT_TEMP
Definition: rejctmap.h:94
bool accept_if_good_quality()
Definition: rejctmap.cpp:81

◆ flag()

bool REJ::flag ( REJ_FLAGS  rej_flag)
inline

Definition at line 132 of file rejctmap.h.

132  {
133  if (rej_flag < 16)
134  return flags1.bit (rej_flag);
135  else
136  return flags2.bit (rej_flag - 16);
137  }
bool bit(uint8_t bit_num) const
Definition: bits16.h:51

◆ full_print()

void REJ::full_print ( FILE *  fp)

Definition at line 232 of file rejctmap.cpp.

232  {
233  fprintf (fp, "R_TESS_FAILURE: %s\n", flag (R_TESS_FAILURE) ? "T" : "F");
234  fprintf (fp, "R_SMALL_XHT: %s\n", flag (R_SMALL_XHT) ? "T" : "F");
235  fprintf (fp, "R_EDGE_CHAR: %s\n", flag (R_EDGE_CHAR) ? "T" : "F");
236  fprintf (fp, "R_1IL_CONFLICT: %s\n", flag (R_1IL_CONFLICT) ? "T" : "F");
237  fprintf (fp, "R_POSTNN_1IL: %s\n", flag (R_POSTNN_1IL) ? "T" : "F");
238  fprintf (fp, "R_REJ_CBLOB: %s\n", flag (R_REJ_CBLOB) ? "T" : "F");
239  fprintf (fp, "R_MM_REJECT: %s\n", flag (R_MM_REJECT) ? "T" : "F");
240  fprintf (fp, "R_BAD_REPETITION: %s\n", flag (R_BAD_REPETITION) ? "T" : "F");
241  fprintf (fp, "R_POOR_MATCH: %s\n", flag (R_POOR_MATCH) ? "T" : "F");
242  fprintf (fp, "R_NOT_TESS_ACCEPTED: %s\n",
243  flag (R_NOT_TESS_ACCEPTED) ? "T" : "F");
244  fprintf (fp, "R_CONTAINS_BLANKS: %s\n",
245  flag (R_CONTAINS_BLANKS) ? "T" : "F");
246  fprintf (fp, "R_BAD_PERMUTER: %s\n", flag (R_BAD_PERMUTER) ? "T" : "F");
247  fprintf (fp, "R_HYPHEN: %s\n", flag (R_HYPHEN) ? "T" : "F");
248  fprintf (fp, "R_DUBIOUS: %s\n", flag (R_DUBIOUS) ? "T" : "F");
249  fprintf (fp, "R_NO_ALPHANUMS: %s\n", flag (R_NO_ALPHANUMS) ? "T" : "F");
250  fprintf (fp, "R_MOSTLY_REJ: %s\n", flag (R_MOSTLY_REJ) ? "T" : "F");
251  fprintf (fp, "R_XHT_FIXUP: %s\n", flag (R_XHT_FIXUP) ? "T" : "F");
252  fprintf (fp, "R_BAD_QUALITY: %s\n", flag (R_BAD_QUALITY) ? "T" : "F");
253  fprintf (fp, "R_DOC_REJ: %s\n", flag (R_DOC_REJ) ? "T" : "F");
254  fprintf (fp, "R_BLOCK_REJ: %s\n", flag (R_BLOCK_REJ) ? "T" : "F");
255  fprintf (fp, "R_ROW_REJ: %s\n", flag (R_ROW_REJ) ? "T" : "F");
256  fprintf (fp, "R_UNLV_REJ: %s\n", flag (R_UNLV_REJ) ? "T" : "F");
257  fprintf (fp, "R_HYPHEN_ACCEPT: %s\n", flag (R_HYPHEN_ACCEPT) ? "T" : "F");
258  fprintf (fp, "R_NN_ACCEPT: %s\n", flag (R_NN_ACCEPT) ? "T" : "F");
259  fprintf (fp, "R_MM_ACCEPT: %s\n", flag (R_MM_ACCEPT) ? "T" : "F");
260  fprintf (fp, "R_QUALITY_ACCEPT: %s\n", flag (R_QUALITY_ACCEPT) ? "T" : "F");
261  fprintf (fp, "R_MINIMAL_REJ_ACCEPT: %s\n",
262  flag (R_MINIMAL_REJ_ACCEPT) ? "T" : "F");
263 }
@ R_MOSTLY_REJ
Definition: rejctmap.h:70
@ R_MM_REJECT
Definition: rejctmap.h:57
@ R_XHT_FIXUP
Definition: rejctmap.h:71
@ R_MINIMAL_REJ_ACCEPT
Definition: rejctmap.h:87
@ R_DUBIOUS
Definition: rejctmap.h:68
@ R_ROW_REJ
Definition: rejctmap.h:79
@ R_BLOCK_REJ
Definition: rejctmap.h:78
@ R_BAD_REPETITION
Definition: rejctmap.h:58
@ R_MM_ACCEPT
Definition: rejctmap.h:85
@ R_REJ_CBLOB
Definition: rejctmap.h:56
@ R_NO_ALPHANUMS
Definition: rejctmap.h:69
@ R_1IL_CONFLICT
Definition: rejctmap.h:54
@ R_BAD_QUALITY
Definition: rejctmap.h:74
@ R_QUALITY_ACCEPT
Definition: rejctmap.h:86
@ R_TESS_FAILURE
Definition: rejctmap.h:51
@ R_POSTNN_1IL
Definition: rejctmap.h:55
@ R_HYPHEN_ACCEPT
Definition: rejctmap.h:84
@ R_HYPHEN
Definition: rejctmap.h:67
@ R_DOC_REJ
Definition: rejctmap.h:77
@ R_EDGE_CHAR
Definition: rejctmap.h:53
@ R_UNLV_REJ
Definition: rejctmap.h:80
@ R_SMALL_XHT
Definition: rejctmap.h:52
@ R_NN_ACCEPT
Definition: rejctmap.h:83

◆ operator=()

REJ& REJ::operator= ( const REJ source)
inline

Definition at line 125 of file rejctmap.h.

126  { //from this
127  flags1 = source.flags1;
128  flags2 = source.flags2;
129  return *this;
130  }

◆ perm_rejected()

bool REJ::perm_rejected ( )

Definition at line 22 of file rejctmap.cpp.

22  { //Is char perm reject?
23  return (flag (R_TESS_FAILURE) ||
24  flag (R_SMALL_XHT) ||
25  flag (R_EDGE_CHAR) ||
26  flag (R_1IL_CONFLICT) ||
27  flag (R_POSTNN_1IL) ||
28  flag (R_REJ_CBLOB) ||
30 }

◆ recoverable()

bool REJ::recoverable ( )
inline

Definition at line 161 of file rejctmap.h.

161  {
162  return (rejected () && !perm_rejected ());
163  }

◆ rejected()

bool REJ::rejected ( )

Definition at line 71 of file rejctmap.cpp.

71  { //Is char rejected?
73  return false;
74  else
75  return (perm_rejected () ||
76  rej_between_quality_and_minimal_rej_accept () ||
77  (!flag (R_QUALITY_ACCEPT) && rej_before_quality_accept ()));
78 }

◆ setrej_1Il_conflict()

void REJ::setrej_1Il_conflict ( )

Definition at line 109 of file rejctmap.cpp.

109  { //Initial reject map
110  set_flag(R_1IL_CONFLICT);
111 }

◆ setrej_bad_permuter()

void REJ::setrej_bad_permuter ( )

Definition at line 151 of file rejctmap.cpp.

151  { //POTENTIAL reject_word
152  set_flag(R_BAD_PERMUTER);
153 }

◆ setrej_bad_quality()

void REJ::setrej_bad_quality ( )

Definition at line 181 of file rejctmap.cpp.

181  { //TEMP reject_word
182  set_flag(R_BAD_QUALITY);
183 }

◆ setrej_bad_repetition()

void REJ::setrej_bad_repetition ( )

Definition at line 129 of file rejctmap.cpp.

129  { //Odd repeated char
130  set_flag(R_BAD_REPETITION);
131 }

◆ setrej_block_rej()

void REJ::setrej_block_rej ( )

Definition at line 191 of file rejctmap.cpp.

191  { //TEMP reject_word
192  set_flag(R_BLOCK_REJ);
193 }

◆ setrej_contains_blanks()

void REJ::setrej_contains_blanks ( )

Definition at line 145 of file rejctmap.cpp.

145  {
146  //TEMP reject_word
147  set_flag(R_CONTAINS_BLANKS);
148 }

◆ setrej_doc_rej()

void REJ::setrej_doc_rej ( )

Definition at line 186 of file rejctmap.cpp.

186  { //TEMP reject_word
187  set_flag(R_DOC_REJ);
188 }

◆ setrej_dubious()

void REJ::setrej_dubious ( )

Definition at line 161 of file rejctmap.cpp.

161  { //PostNN dubious limit
162  set_flag(R_DUBIOUS);
163 }

◆ setrej_edge_char()

void REJ::setrej_edge_char ( )

Definition at line 104 of file rejctmap.cpp.

104  { //Close to image edge
105  set_flag(R_EDGE_CHAR);
106 }

◆ setrej_hyphen()

void REJ::setrej_hyphen ( )

Definition at line 156 of file rejctmap.cpp.

156  { //PostNN dubious hyphen or .
157  set_flag(R_HYPHEN);
158 }

◆ setrej_hyphen_accept()

void REJ::setrej_hyphen_accept ( )

Definition at line 206 of file rejctmap.cpp.

206  { //NN Flipped a char
207  set_flag(R_HYPHEN_ACCEPT);
208 }

◆ setrej_minimal_rej_accept()

void REJ::setrej_minimal_rej_accept ( )

Definition at line 226 of file rejctmap.cpp.

226  {
227  //Accept all except blank
228  set_flag(R_MINIMAL_REJ_ACCEPT);
229 }

◆ setrej_mm_accept()

void REJ::setrej_mm_accept ( )

Definition at line 216 of file rejctmap.cpp.

216  { //Matrix matcher
217  set_flag(R_MM_ACCEPT);
218 }

◆ setrej_mm_reject()

void REJ::setrej_mm_reject ( )

Definition at line 124 of file rejctmap.cpp.

124  { //Matrix matcher
125  set_flag(R_MM_REJECT);
126 }

◆ setrej_mostly_rej()

void REJ::setrej_mostly_rej ( )

Definition at line 171 of file rejctmap.cpp.

171  { //TEMP reject_word
172  set_flag(R_MOSTLY_REJ);
173 }

◆ setrej_nn_accept()

void REJ::setrej_nn_accept ( )

Definition at line 211 of file rejctmap.cpp.

211  { //NN Flipped a char
212  set_flag(R_NN_ACCEPT);
213 }

◆ setrej_no_alphanums()

void REJ::setrej_no_alphanums ( )

Definition at line 166 of file rejctmap.cpp.

166  { //TEMP reject_word
167  set_flag(R_NO_ALPHANUMS);
168 }

◆ setrej_not_tess_accepted()

void REJ::setrej_not_tess_accepted ( )

Definition at line 139 of file rejctmap.cpp.

139  {
140  //TEMP reject_word
141  set_flag(R_NOT_TESS_ACCEPTED);
142 }

◆ setrej_poor_match()

void REJ::setrej_poor_match ( )

Definition at line 134 of file rejctmap.cpp.

134  { //Failed Rays heuristic
135  set_flag(R_POOR_MATCH);
136 }

◆ setrej_postNN_1Il()

void REJ::setrej_postNN_1Il ( )

Definition at line 114 of file rejctmap.cpp.

114  { //1Il after NN
115  set_flag(R_POSTNN_1IL);
116 }

◆ setrej_quality_accept()

void REJ::setrej_quality_accept ( )

Definition at line 221 of file rejctmap.cpp.

221  { //Quality flip a char
222  set_flag(R_QUALITY_ACCEPT);
223 }

◆ setrej_rej_cblob()

void REJ::setrej_rej_cblob ( )

Definition at line 119 of file rejctmap.cpp.

119  { //Insert duff blob
120  set_flag(R_REJ_CBLOB);
121 }

◆ setrej_row_rej()

void REJ::setrej_row_rej ( )

Definition at line 196 of file rejctmap.cpp.

196  { //TEMP reject_word
197  set_flag(R_ROW_REJ);
198 }

◆ setrej_small_xht()

void REJ::setrej_small_xht ( )

Definition at line 99 of file rejctmap.cpp.

99  { //Small xht char/wd
100  set_flag(R_SMALL_XHT);
101 }

◆ setrej_tess_failure()

void REJ::setrej_tess_failure ( )

Definition at line 94 of file rejctmap.cpp.

94  { //Tess generated blank
95  set_flag(R_TESS_FAILURE);
96 }

◆ setrej_unlv_rej()

void REJ::setrej_unlv_rej ( )

Definition at line 201 of file rejctmap.cpp.

201  { //TEMP reject_word
202  set_flag(R_UNLV_REJ);
203 }

◆ setrej_xht_fixup()

void REJ::setrej_xht_fixup ( )

Definition at line 176 of file rejctmap.cpp.

176  { //xht fixup
177  set_flag(R_XHT_FIXUP);
178 }

The documentation for this class was generated from the following files: