tesseract  4.0.0-1-g2a2b
tesseract::AmbigSpec Class Reference

#include <ambigs.h>

Inheritance diagram for tesseract::AmbigSpec:
ELIST_LINK

Public Member Functions

 AmbigSpec ()
 
 ~AmbigSpec ()=default
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Static Public Member Functions

static int compare_ambig_specs (const void *spec1, const void *spec2)
 

Public Attributes

UNICHAR_ID wrong_ngram [MAX_AMBIG_SIZE+1]
 
UNICHAR_ID correct_fragments [MAX_AMBIG_SIZE+1]
 
UNICHAR_ID correct_ngram_id
 
AmbigType type
 
int wrong_ngram_size
 

Detailed Description

Definition at line 114 of file ambigs.h.

Constructor & Destructor Documentation

◆ AmbigSpec()

tesseract::AmbigSpec::AmbigSpec ( )

Definition at line 38 of file ambigs.cpp.

38  {
39  wrong_ngram[0] = INVALID_UNICHAR_ID;
40  correct_fragments[0] = INVALID_UNICHAR_ID;
41  correct_ngram_id = INVALID_UNICHAR_ID;
42  type = NOT_AMBIG;
43  wrong_ngram_size = 0;
44 }
UNICHAR_ID correct_ngram_id
Definition: ambigs.h:133
UNICHAR_ID correct_fragments[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:132
AmbigType type
Definition: ambigs.h:134
UNICHAR_ID wrong_ngram[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:131

◆ ~AmbigSpec()

tesseract::AmbigSpec::~AmbigSpec ( )
default

Member Function Documentation

◆ compare_ambig_specs()

static int tesseract::AmbigSpec::compare_ambig_specs ( const void *  spec1,
const void *  spec2 
)
inlinestatic

Definition at line 122 of file ambigs.h.

122  {
123  const AmbigSpec *s1 = *static_cast<const AmbigSpec *const *>(spec1);
124  const AmbigSpec *s2 = *static_cast<const AmbigSpec *const *>(spec2);
125  int result = UnicharIdArrayUtils::compare(s1->wrong_ngram, s2->wrong_ngram);
126  if (result != 0) return result;
127  return UnicharIdArrayUtils::compare(s1->correct_fragments,
128  s2->correct_fragments);
129  }
static int compare(const UNICHAR_ID *ptr1, const UNICHAR_ID *ptr2)
Definition: ambigs.h:62

Member Data Documentation

◆ correct_fragments

UNICHAR_ID tesseract::AmbigSpec::correct_fragments[MAX_AMBIG_SIZE+1]

Definition at line 132 of file ambigs.h.

◆ correct_ngram_id

UNICHAR_ID tesseract::AmbigSpec::correct_ngram_id

Definition at line 133 of file ambigs.h.

◆ type

AmbigType tesseract::AmbigSpec::type

Definition at line 134 of file ambigs.h.

◆ wrong_ngram

UNICHAR_ID tesseract::AmbigSpec::wrong_ngram[MAX_AMBIG_SIZE+1]

Definition at line 131 of file ambigs.h.

◆ wrong_ngram_size

int tesseract::AmbigSpec::wrong_ngram_size

Definition at line 135 of file ambigs.h.


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