tesseract  5.0.0-alpha-619-ge9db
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 96 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 118 of file rejctmap.h.

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

Member Function Documentation

◆ accept_if_good_quality()

bool REJ::accept_if_good_quality ( )

Definition at line 80 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 ()));

◆ accepted()

bool REJ::accepted ( )
inline

Definition at line 153 of file rejctmap.h.

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

◆ display_char()

char REJ::display_char ( )
inline

Definition at line 138 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;

◆ flag()

bool REJ::flag ( REJ_FLAGS  rej_flag)
inline

Definition at line 131 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);

◆ full_print()

void REJ::full_print ( FILE *  fp)

Definition at line 231 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");

◆ operator=()

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

Definition at line 124 of file rejctmap.h.

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

◆ perm_rejected()

bool REJ::perm_rejected ( )

Definition at line 21 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) ||

◆ recoverable()

bool REJ::recoverable ( )
inline

Definition at line 160 of file rejctmap.h.

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

◆ rejected()

bool REJ::rejected ( )

Definition at line 70 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 ()));

◆ setrej_1Il_conflict()

void REJ::setrej_1Il_conflict ( )

Definition at line 108 of file rejctmap.cpp.

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

◆ setrej_bad_permuter()

void REJ::setrej_bad_permuter ( )

Definition at line 150 of file rejctmap.cpp.

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

◆ setrej_bad_quality()

void REJ::setrej_bad_quality ( )

Definition at line 180 of file rejctmap.cpp.

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

◆ setrej_bad_repetition()

void REJ::setrej_bad_repetition ( )

Definition at line 128 of file rejctmap.cpp.

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

◆ setrej_block_rej()

void REJ::setrej_block_rej ( )

Definition at line 190 of file rejctmap.cpp.

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

◆ setrej_contains_blanks()

void REJ::setrej_contains_blanks ( )

Definition at line 144 of file rejctmap.cpp.

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

◆ setrej_doc_rej()

void REJ::setrej_doc_rej ( )

Definition at line 185 of file rejctmap.cpp.

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

◆ setrej_dubious()

void REJ::setrej_dubious ( )

Definition at line 160 of file rejctmap.cpp.

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

◆ setrej_edge_char()

void REJ::setrej_edge_char ( )

Definition at line 103 of file rejctmap.cpp.

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

◆ setrej_hyphen()

void REJ::setrej_hyphen ( )

Definition at line 155 of file rejctmap.cpp.

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

◆ setrej_hyphen_accept()

void REJ::setrej_hyphen_accept ( )

Definition at line 205 of file rejctmap.cpp.

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

◆ setrej_minimal_rej_accept()

void REJ::setrej_minimal_rej_accept ( )

Definition at line 225 of file rejctmap.cpp.

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

◆ setrej_mm_accept()

void REJ::setrej_mm_accept ( )

Definition at line 215 of file rejctmap.cpp.

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

◆ setrej_mm_reject()

void REJ::setrej_mm_reject ( )

Definition at line 123 of file rejctmap.cpp.

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

◆ setrej_mostly_rej()

void REJ::setrej_mostly_rej ( )

Definition at line 170 of file rejctmap.cpp.

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

◆ setrej_nn_accept()

void REJ::setrej_nn_accept ( )

Definition at line 210 of file rejctmap.cpp.

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

◆ setrej_no_alphanums()

void REJ::setrej_no_alphanums ( )

Definition at line 165 of file rejctmap.cpp.

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

◆ setrej_not_tess_accepted()

void REJ::setrej_not_tess_accepted ( )

Definition at line 138 of file rejctmap.cpp.

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

◆ setrej_poor_match()

void REJ::setrej_poor_match ( )

Definition at line 133 of file rejctmap.cpp.

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

◆ setrej_postNN_1Il()

void REJ::setrej_postNN_1Il ( )

Definition at line 113 of file rejctmap.cpp.

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

◆ setrej_quality_accept()

void REJ::setrej_quality_accept ( )

Definition at line 220 of file rejctmap.cpp.

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

◆ setrej_rej_cblob()

void REJ::setrej_rej_cblob ( )

Definition at line 118 of file rejctmap.cpp.

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

◆ setrej_row_rej()

void REJ::setrej_row_rej ( )

Definition at line 195 of file rejctmap.cpp.

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

◆ setrej_small_xht()

void REJ::setrej_small_xht ( )

Definition at line 98 of file rejctmap.cpp.

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

◆ setrej_tess_failure()

void REJ::setrej_tess_failure ( )

Definition at line 93 of file rejctmap.cpp.

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

◆ setrej_unlv_rej()

void REJ::setrej_unlv_rej ( )

Definition at line 200 of file rejctmap.cpp.

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

◆ setrej_xht_fixup()

void REJ::setrej_xht_fixup ( )

Definition at line 175 of file rejctmap.cpp.

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

The documentation for this class was generated from the following files:
R_TESS_FAILURE
Definition: rejctmap.h:87
R_BAD_PERMUTER
Definition: rejctmap.h:100
BITS16::bit
bool bit(uint8_t bit_num) const
Definition: bits16.h:65
R_BAD_QUALITY
Definition: rejctmap.h:110
R_EDGE_CHAR
Definition: rejctmap.h:89
R_POOR_MATCH
Definition: rejctmap.h:97
R_SMALL_XHT
Definition: rejctmap.h:88
R_CONTAINS_BLANKS
Definition: rejctmap.h:99
R_DUBIOUS
Definition: rejctmap.h:104
R_MOSTLY_REJ
Definition: rejctmap.h:106
R_QUALITY_ACCEPT
Definition: rejctmap.h:122
R_HYPHEN
Definition: rejctmap.h:103
R_DOC_REJ
Definition: rejctmap.h:113
R_UNLV_REJ
Definition: rejctmap.h:116
R_NN_ACCEPT
Definition: rejctmap.h:119
MAP_REJECT_POTENTIAL
#define MAP_REJECT_POTENTIAL
Definition: rejctmap.h:94
REJ::perm_rejected
bool perm_rejected()
Definition: rejctmap.cpp:21
R_REJ_CBLOB
Definition: rejctmap.h:92
R_MINIMAL_REJ_ACCEPT
Definition: rejctmap.h:123
R_NOT_TESS_ACCEPTED
Definition: rejctmap.h:98
R_BAD_REPETITION
Definition: rejctmap.h:94
R_1IL_CONFLICT
Definition: rejctmap.h:90
MAP_ACCEPT
#define MAP_ACCEPT
Definition: rejctmap.h:91
R_HYPHEN_ACCEPT
Definition: rejctmap.h:120
R_XHT_FIXUP
Definition: rejctmap.h:107
MAP_REJECT_TEMP
#define MAP_REJECT_TEMP
Definition: rejctmap.h:93
R_ROW_REJ
Definition: rejctmap.h:115
REJ::rejected
bool rejected()
Definition: rejctmap.cpp:70
R_MM_ACCEPT
Definition: rejctmap.h:121
REJ::accept_if_good_quality
bool accept_if_good_quality()
Definition: rejctmap.cpp:80
R_MM_REJECT
Definition: rejctmap.h:93
MAP_REJECT_PERM
#define MAP_REJECT_PERM
Definition: rejctmap.h:92
R_NO_ALPHANUMS
Definition: rejctmap.h:105
R_BLOCK_REJ
Definition: rejctmap.h:114
R_POSTNN_1IL
Definition: rejctmap.h:91
REJ::flag
bool flag(REJ_FLAGS rej_flag)
Definition: rejctmap.h:131