tesseract  4.0.0-1-g2a2b
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 83 of file rejctmap.cpp.

83  { //potential rej?
84  return (rejected () &&
85  !perm_rejected () &&
86  flag (R_BAD_PERMUTER) &&
87  !flag (R_POOR_MATCH) &&
90  (!rej_between_nn_and_mm () &&
91  !rej_between_mm_and_quality_accept () &&
92  !rej_between_quality_and_minimal_rej_accept ()));
93 }
bool perm_rejected()
Definition: rejctmap.cpp:24
bool rejected()
Definition: rejctmap.cpp:73
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:132

◆ accepted()

bool REJ::accepted ( )
inline

Definition at line 154 of file rejctmap.h.

154  { //Is char accepted?
155  return !rejected ();
156  }
bool rejected()
Definition: rejctmap.cpp:73

◆ 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_PERM
Definition: rejctmap.h:93
#define MAP_REJECT_POTENTIAL
Definition: rejctmap.h:95
bool perm_rejected()
Definition: rejctmap.cpp:24
bool rejected()
Definition: rejctmap.cpp:73
bool accept_if_good_quality()
Definition: rejctmap.cpp:83
#define MAP_REJECT_TEMP
Definition: rejctmap.h:94

◆ 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:57

◆ full_print()

void REJ::full_print ( FILE *  fp)

Definition at line 234 of file rejctmap.cpp.

234  {
235  fprintf (fp, "R_TESS_FAILURE: %s\n", flag (R_TESS_FAILURE) ? "T" : "F");
236  fprintf (fp, "R_SMALL_XHT: %s\n", flag (R_SMALL_XHT) ? "T" : "F");
237  fprintf (fp, "R_EDGE_CHAR: %s\n", flag (R_EDGE_CHAR) ? "T" : "F");
238  fprintf (fp, "R_1IL_CONFLICT: %s\n", flag (R_1IL_CONFLICT) ? "T" : "F");
239  fprintf (fp, "R_POSTNN_1IL: %s\n", flag (R_POSTNN_1IL) ? "T" : "F");
240  fprintf (fp, "R_REJ_CBLOB: %s\n", flag (R_REJ_CBLOB) ? "T" : "F");
241  fprintf (fp, "R_MM_REJECT: %s\n", flag (R_MM_REJECT) ? "T" : "F");
242  fprintf (fp, "R_BAD_REPETITION: %s\n", flag (R_BAD_REPETITION) ? "T" : "F");
243  fprintf (fp, "R_POOR_MATCH: %s\n", flag (R_POOR_MATCH) ? "T" : "F");
244  fprintf (fp, "R_NOT_TESS_ACCEPTED: %s\n",
245  flag (R_NOT_TESS_ACCEPTED) ? "T" : "F");
246  fprintf (fp, "R_CONTAINS_BLANKS: %s\n",
247  flag (R_CONTAINS_BLANKS) ? "T" : "F");
248  fprintf (fp, "R_BAD_PERMUTER: %s\n", flag (R_BAD_PERMUTER) ? "T" : "F");
249  fprintf (fp, "R_HYPHEN: %s\n", flag (R_HYPHEN) ? "T" : "F");
250  fprintf (fp, "R_DUBIOUS: %s\n", flag (R_DUBIOUS) ? "T" : "F");
251  fprintf (fp, "R_NO_ALPHANUMS: %s\n", flag (R_NO_ALPHANUMS) ? "T" : "F");
252  fprintf (fp, "R_MOSTLY_REJ: %s\n", flag (R_MOSTLY_REJ) ? "T" : "F");
253  fprintf (fp, "R_XHT_FIXUP: %s\n", flag (R_XHT_FIXUP) ? "T" : "F");
254  fprintf (fp, "R_BAD_QUALITY: %s\n", flag (R_BAD_QUALITY) ? "T" : "F");
255  fprintf (fp, "R_DOC_REJ: %s\n", flag (R_DOC_REJ) ? "T" : "F");
256  fprintf (fp, "R_BLOCK_REJ: %s\n", flag (R_BLOCK_REJ) ? "T" : "F");
257  fprintf (fp, "R_ROW_REJ: %s\n", flag (R_ROW_REJ) ? "T" : "F");
258  fprintf (fp, "R_UNLV_REJ: %s\n", flag (R_UNLV_REJ) ? "T" : "F");
259  fprintf (fp, "R_HYPHEN_ACCEPT: %s\n", flag (R_HYPHEN_ACCEPT) ? "T" : "F");
260  fprintf (fp, "R_NN_ACCEPT: %s\n", flag (R_NN_ACCEPT) ? "T" : "F");
261  fprintf (fp, "R_MM_ACCEPT: %s\n", flag (R_MM_ACCEPT) ? "T" : "F");
262  fprintf (fp, "R_QUALITY_ACCEPT: %s\n", flag (R_QUALITY_ACCEPT) ? "T" : "F");
263  fprintf (fp, "R_MINIMAL_REJ_ACCEPT: %s\n",
264  flag (R_MINIMAL_REJ_ACCEPT) ? "T" : "F");
265 }
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:132

◆ 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 24 of file rejctmap.cpp.

24  { //Is char perm reject?
25  return (flag (R_TESS_FAILURE) ||
26  flag (R_SMALL_XHT) ||
27  flag (R_EDGE_CHAR) ||
28  flag (R_1IL_CONFLICT) ||
29  flag (R_POSTNN_1IL) ||
30  flag (R_REJ_CBLOB) ||
32 }
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:132

◆ recoverable()

bool REJ::recoverable ( )
inline

Definition at line 161 of file rejctmap.h.

161  {
162  return (rejected () && !perm_rejected ());
163  }
bool perm_rejected()
Definition: rejctmap.cpp:24
bool rejected()
Definition: rejctmap.cpp:73

◆ rejected()

bool REJ::rejected ( )

Definition at line 73 of file rejctmap.cpp.

73  { //Is char rejected?
75  return false;
76  else
77  return (perm_rejected () ||
78  rej_between_quality_and_minimal_rej_accept () ||
79  (!flag (R_QUALITY_ACCEPT) && rej_before_quality_accept ()));
80 }
bool perm_rejected()
Definition: rejctmap.cpp:24
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:132

◆ setrej_1Il_conflict()

void REJ::setrej_1Il_conflict ( )

Definition at line 111 of file rejctmap.cpp.

111  { //Initial reject map
112  set_flag(R_1IL_CONFLICT);
113 }

◆ setrej_bad_permuter()

void REJ::setrej_bad_permuter ( )

Definition at line 153 of file rejctmap.cpp.

153  { //POTENTIAL reject_word
154  set_flag(R_BAD_PERMUTER);
155 }

◆ setrej_bad_quality()

void REJ::setrej_bad_quality ( )

Definition at line 183 of file rejctmap.cpp.

183  { //TEMP reject_word
184  set_flag(R_BAD_QUALITY);
185 }

◆ setrej_bad_repetition()

void REJ::setrej_bad_repetition ( )

Definition at line 131 of file rejctmap.cpp.

131  { //Odd repeated char
132  set_flag(R_BAD_REPETITION);
133 }

◆ setrej_block_rej()

void REJ::setrej_block_rej ( )

Definition at line 193 of file rejctmap.cpp.

193  { //TEMP reject_word
194  set_flag(R_BLOCK_REJ);
195 }

◆ setrej_contains_blanks()

void REJ::setrej_contains_blanks ( )

Definition at line 147 of file rejctmap.cpp.

147  {
148  //TEMP reject_word
149  set_flag(R_CONTAINS_BLANKS);
150 }

◆ setrej_doc_rej()

void REJ::setrej_doc_rej ( )

Definition at line 188 of file rejctmap.cpp.

188  { //TEMP reject_word
189  set_flag(R_DOC_REJ);
190 }

◆ setrej_dubious()

void REJ::setrej_dubious ( )

Definition at line 163 of file rejctmap.cpp.

163  { //PostNN dubious limit
164  set_flag(R_DUBIOUS);
165 }

◆ setrej_edge_char()

void REJ::setrej_edge_char ( )

Definition at line 106 of file rejctmap.cpp.

106  { //Close to image edge
107  set_flag(R_EDGE_CHAR);
108 }

◆ setrej_hyphen()

void REJ::setrej_hyphen ( )

Definition at line 158 of file rejctmap.cpp.

158  { //PostNN dubious hyphen or .
159  set_flag(R_HYPHEN);
160 }

◆ setrej_hyphen_accept()

void REJ::setrej_hyphen_accept ( )

Definition at line 208 of file rejctmap.cpp.

208  { //NN Flipped a char
209  set_flag(R_HYPHEN_ACCEPT);
210 }

◆ setrej_minimal_rej_accept()

void REJ::setrej_minimal_rej_accept ( )

Definition at line 228 of file rejctmap.cpp.

228  {
229  //Accept all except blank
230  set_flag(R_MINIMAL_REJ_ACCEPT);
231 }

◆ setrej_mm_accept()

void REJ::setrej_mm_accept ( )

Definition at line 218 of file rejctmap.cpp.

218  { //Matrix matcher
219  set_flag(R_MM_ACCEPT);
220 }

◆ setrej_mm_reject()

void REJ::setrej_mm_reject ( )

Definition at line 126 of file rejctmap.cpp.

126  { //Matrix matcher
127  set_flag(R_MM_REJECT);
128 }

◆ setrej_mostly_rej()

void REJ::setrej_mostly_rej ( )

Definition at line 173 of file rejctmap.cpp.

173  { //TEMP reject_word
174  set_flag(R_MOSTLY_REJ);
175 }

◆ setrej_nn_accept()

void REJ::setrej_nn_accept ( )

Definition at line 213 of file rejctmap.cpp.

213  { //NN Flipped a char
214  set_flag(R_NN_ACCEPT);
215 }

◆ setrej_no_alphanums()

void REJ::setrej_no_alphanums ( )

Definition at line 168 of file rejctmap.cpp.

168  { //TEMP reject_word
169  set_flag(R_NO_ALPHANUMS);
170 }

◆ setrej_not_tess_accepted()

void REJ::setrej_not_tess_accepted ( )

Definition at line 141 of file rejctmap.cpp.

141  {
142  //TEMP reject_word
143  set_flag(R_NOT_TESS_ACCEPTED);
144 }

◆ setrej_poor_match()

void REJ::setrej_poor_match ( )

Definition at line 136 of file rejctmap.cpp.

136  { //Failed Rays heuristic
137  set_flag(R_POOR_MATCH);
138 }

◆ setrej_postNN_1Il()

void REJ::setrej_postNN_1Il ( )

Definition at line 116 of file rejctmap.cpp.

116  { //1Il after NN
117  set_flag(R_POSTNN_1IL);
118 }

◆ setrej_quality_accept()

void REJ::setrej_quality_accept ( )

Definition at line 223 of file rejctmap.cpp.

223  { //Quality flip a char
224  set_flag(R_QUALITY_ACCEPT);
225 }

◆ setrej_rej_cblob()

void REJ::setrej_rej_cblob ( )

Definition at line 121 of file rejctmap.cpp.

121  { //Insert duff blob
122  set_flag(R_REJ_CBLOB);
123 }

◆ setrej_row_rej()

void REJ::setrej_row_rej ( )

Definition at line 198 of file rejctmap.cpp.

198  { //TEMP reject_word
199  set_flag(R_ROW_REJ);
200 }

◆ setrej_small_xht()

void REJ::setrej_small_xht ( )

Definition at line 101 of file rejctmap.cpp.

101  { //Small xht char/wd
102  set_flag(R_SMALL_XHT);
103 }

◆ setrej_tess_failure()

void REJ::setrej_tess_failure ( )

Definition at line 96 of file rejctmap.cpp.

96  { //Tess generated blank
97  set_flag(R_TESS_FAILURE);
98 }

◆ setrej_unlv_rej()

void REJ::setrej_unlv_rej ( )

Definition at line 203 of file rejctmap.cpp.

203  { //TEMP reject_word
204  set_flag(R_UNLV_REJ);
205 }

◆ setrej_xht_fixup()

void REJ::setrej_xht_fixup ( )

Definition at line 178 of file rejctmap.cpp.

178  { //xht fixup
179  set_flag(R_XHT_FIXUP);
180 }

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