tesseract v5.3.3.20231005
tesseract::AmbigSpec Class Reference

#include <ambigs.h>

Inheritance diagram for tesseract::AmbigSpec:
tesseract::ELIST_LINK

Public Member Functions

 AmbigSpec ()
 
 ~AmbigSpec ()=default
 
- Public Member Functions inherited from tesseract::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 112 of file ambigs.h.

Constructor & Destructor Documentation

◆ AmbigSpec()

tesseract::AmbigSpec::AmbigSpec ( )

Definition at line 42 of file ambigs.cpp.

42 {
43 wrong_ngram[0] = INVALID_UNICHAR_ID;
44 correct_fragments[0] = INVALID_UNICHAR_ID;
45 correct_ngram_id = INVALID_UNICHAR_ID;
48}
@ NOT_AMBIG
Definition: ambigs.h:41
UNICHAR_ID correct_ngram_id
Definition: ambigs.h:132
UNICHAR_ID wrong_ngram[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:130
UNICHAR_ID correct_fragments[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:131
AmbigType type
Definition: ambigs.h:133

◆ ~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 120 of file ambigs.h.

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

Member Data Documentation

◆ correct_fragments

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

Definition at line 131 of file ambigs.h.

◆ correct_ngram_id

UNICHAR_ID tesseract::AmbigSpec::correct_ngram_id

Definition at line 132 of file ambigs.h.

◆ type

AmbigType tesseract::AmbigSpec::type

Definition at line 133 of file ambigs.h.

◆ wrong_ngram

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

Definition at line 130 of file ambigs.h.

◆ wrong_ngram_size

int tesseract::AmbigSpec::wrong_ngram_size

Definition at line 134 of file ambigs.h.


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