tesseract  5.0.0-alpha-619-ge9db
REJMAP Class Reference

#include <rejctmap.h>

Public Member Functions

 REJMAP ()
 
 REJMAP (const REJMAP &rejmap)
 
REJMAPoperator= (const REJMAP &source)
 
void initialise (int16_t length)
 
REJoperator[] (int16_t index) const
 
int32_t length () const
 
int16_t accept_count ()
 
int16_t reject_count ()
 
void remove_pos (int16_t pos)
 
void print (FILE *fp)
 
void full_print (FILE *fp)
 
bool recoverable_rejects ()
 
bool quality_recoverable_rejects ()
 
void rej_word_small_xht ()
 
void rej_word_tess_failure ()
 
void rej_word_not_tess_accepted ()
 
void rej_word_contains_blanks ()
 
void rej_word_bad_permuter ()
 
void rej_word_xht_fixup ()
 
void rej_word_no_alphanums ()
 
void rej_word_mostly_rej ()
 
void rej_word_bad_quality ()
 
void rej_word_doc_rej ()
 
void rej_word_block_rej ()
 
void rej_word_row_rej ()
 

Detailed Description

Definition at line 200 of file rejctmap.h.

Constructor & Destructor Documentation

◆ REJMAP() [1/2]

REJMAP::REJMAP ( )
inline

Definition at line 206 of file rejctmap.h.

206 :
207  REJMAP() : len(0) {}

◆ REJMAP() [2/2]

REJMAP::REJMAP ( const REJMAP rejmap)
inline

Definition at line 208 of file rejctmap.h.

209 { *this = rejmap; }

Member Function Documentation

◆ accept_count()

int16_t REJMAP::accept_count ( )

Definition at line 278 of file rejctmap.cpp.

279  { //How many accepted?
280  int i;
281  int16_t count = 0;
282 
283  for (i = 0; i < len; i++) {
284  if (ptr[i].accepted ())
285  count++;
286  }
287  return count;

◆ full_print()

void REJMAP::full_print ( FILE *  fp)

Definition at line 332 of file rejctmap.cpp.

333  {
334  int i;
335 
336  for (i = 0; i < len; i++) {
337  ptr[i].full_print (fp);
338  fprintf (fp, "\n");
339  }

◆ initialise()

void REJMAP::initialise ( int16_t  length)

Definition at line 272 of file rejctmap.cpp.

273  {
274  ptr.reset(new REJ[length]);
275  len = length;

◆ length()

int32_t REJMAP::length ( ) const
inline

Definition at line 222 of file rejctmap.h.

223  { //map length
224  return len;

◆ operator=()

REJMAP & REJMAP::operator= ( const REJMAP source)

Definition at line 264 of file rejctmap.cpp.

265  {
266  initialise(source.len);
267  for (int i = 0; i < len; i++) {
268  ptr[i] = source.ptr[i];
269  }
270  return *this;

◆ operator[]()

REJ& REJMAP::operator[] ( int16_t  index) const
inline

Definition at line 215 of file rejctmap.h.

218  {
219  ASSERT_HOST(index < len);
220  return ptr[index]; // no bounds checks

◆ print()

void REJMAP::print ( FILE *  fp)

Definition at line 320 of file rejctmap.cpp.

321  {
322  int i;
323  char buff[512];
324 
325  for (i = 0; i < len; i++) {
326  buff[i] = ptr[i].display_char ();
327  }
328  buff[i] = '\0';
329  fprintf (fp, "\"%s\"", buff);

◆ quality_recoverable_rejects()

bool REJMAP::quality_recoverable_rejects ( )

Definition at line 299 of file rejctmap.cpp.

300  { //Any potential rejs?
301  for (int i = 0; i < len; i++) {
302  if (ptr[i].accept_if_good_quality ())
303  return true;
304  }
305  return false;

◆ recoverable_rejects()

bool REJMAP::recoverable_rejects ( )

Definition at line 290 of file rejctmap.cpp.

291  { //Any non perm rejs?
292  for (int i = 0; i < len; i++) {
293  if (ptr[i].recoverable ())
294  return true;
295  }
296  return false;

◆ rej_word_bad_permuter()

void REJMAP::rej_word_bad_permuter ( )

Definition at line 378 of file rejctmap.cpp.

379  { //Reject whole word
380  int i;
381 
382  for (i = 0; i < len; i++) {
383  if (ptr[i].accepted()) ptr[i].setrej_bad_permuter ();
384  }

◆ rej_word_bad_quality()

void REJMAP::rej_word_bad_quality ( )

Definition at line 414 of file rejctmap.cpp.

415  { //Reject whole word
416  int i;
417 
418  for (i = 0; i < len; i++) {
419  if (ptr[i].accepted()) ptr[i].setrej_bad_quality();
420  }

◆ rej_word_block_rej()

void REJMAP::rej_word_block_rej ( )

Definition at line 432 of file rejctmap.cpp.

433  { //Reject whole word
434  int i;
435 
436  for (i = 0; i < len; i++) {
437  if (ptr[i].accepted()) ptr[i].setrej_block_rej();
438  }

◆ rej_word_contains_blanks()

void REJMAP::rej_word_contains_blanks ( )

Definition at line 369 of file rejctmap.cpp.

370  { //Reject whole word
371  int i;
372 
373  for (i = 0; i < len; i++) {
374  if (ptr[i].accepted()) ptr[i].setrej_contains_blanks();
375  }

◆ rej_word_doc_rej()

void REJMAP::rej_word_doc_rej ( )

Definition at line 423 of file rejctmap.cpp.

424  { //Reject whole word
425  int i;
426 
427  for (i = 0; i < len; i++) {
428  if (ptr[i].accepted()) ptr[i].setrej_doc_rej();
429  }

◆ rej_word_mostly_rej()

void REJMAP::rej_word_mostly_rej ( )

Definition at line 405 of file rejctmap.cpp.

406  { //Reject whole word
407  int i;
408 
409  for (i = 0; i < len; i++) {
410  if (ptr[i].accepted()) ptr[i].setrej_mostly_rej();
411  }

◆ rej_word_no_alphanums()

void REJMAP::rej_word_no_alphanums ( )

Definition at line 396 of file rejctmap.cpp.

397  { //Reject whole word
398  int i;
399 
400  for (i = 0; i < len; i++) {
401  if (ptr[i].accepted()) ptr[i].setrej_no_alphanums();
402  }

◆ rej_word_not_tess_accepted()

void REJMAP::rej_word_not_tess_accepted ( )

Definition at line 360 of file rejctmap.cpp.

361  { //Reject whole word
362  int i;
363 
364  for (i = 0; i < len; i++) {
365  if (ptr[i].accepted()) ptr[i].setrej_not_tess_accepted();
366  }

◆ rej_word_row_rej()

void REJMAP::rej_word_row_rej ( )

Definition at line 441 of file rejctmap.cpp.

442  { //Reject whole word
443  int i;
444 
445  for (i = 0; i < len; i++) {
446  if (ptr[i].accepted()) ptr[i].setrej_row_rej();
447  }

◆ rej_word_small_xht()

void REJMAP::rej_word_small_xht ( )

Definition at line 342 of file rejctmap.cpp.

343  { //Reject whole word
344  int i;
345 
346  for (i = 0; i < len; i++) {
347  ptr[i].setrej_small_xht ();
348  }

◆ rej_word_tess_failure()

void REJMAP::rej_word_tess_failure ( )

Definition at line 351 of file rejctmap.cpp.

352  { //Reject whole word
353  int i;
354 
355  for (i = 0; i < len; i++) {
356  ptr[i].setrej_tess_failure ();
357  }

◆ rej_word_xht_fixup()

void REJMAP::rej_word_xht_fixup ( )

Definition at line 387 of file rejctmap.cpp.

388  { //Reject whole word
389  int i;
390 
391  for (i = 0; i < len; i++) {
392  if (ptr[i].accepted()) ptr[i].setrej_xht_fixup();
393  }

◆ reject_count()

int16_t REJMAP::reject_count ( )
inline

Definition at line 228 of file rejctmap.h.

229  { //How many rejects?
230  return len - accept_count ();

◆ remove_pos()

void REJMAP::remove_pos ( int16_t  pos)

Definition at line 308 of file rejctmap.cpp.

311  {
312  ASSERT_HOST (pos >= 0);
313  ASSERT_HOST (pos < len);
314  ASSERT_HOST (len > 0);
315 
316  len--;
317  for (; pos < len; pos++) ptr[pos] = ptr[pos + 1];

The documentation for this class was generated from the following files:
REJMAP::accept_count
int16_t accept_count()
Definition: rejctmap.cpp:278
REJMAP::initialise
void initialise(int16_t length)
Definition: rejctmap.cpp:272
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:87
REJMAP::REJMAP
REJMAP()
Definition: rejctmap.h:206
REJ
Definition: rejctmap.h:96
REJMAP::length
int32_t length() const
Definition: rejctmap.h:222
count
int count(LIST var_list)
Definition: oldlist.cpp:79