tesseract  5.0.0-alpha-619-ge9db
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 107 of file ambigs.h.

Constructor & Destructor Documentation

◆ AmbigSpec()

tesseract::AmbigSpec::AmbigSpec ( )

Definition at line 43 of file ambigs.cpp.

43  {
44  wrong_ngram[0] = INVALID_UNICHAR_ID;
45  correct_fragments[0] = INVALID_UNICHAR_ID;
46  correct_ngram_id = INVALID_UNICHAR_ID;
47  type = NOT_AMBIG;
48  wrong_ngram_size = 0;
49 }

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

115  {
116  const AmbigSpec *s1 = *static_cast<const AmbigSpec *const *>(spec1);
117  const AmbigSpec *s2 = *static_cast<const AmbigSpec *const *>(spec2);
118  int result = UnicharIdArrayUtils::compare(s1->wrong_ngram, s2->wrong_ngram);
119  if (result != 0) return result;
120  return UnicharIdArrayUtils::compare(s1->correct_fragments,
121  s2->correct_fragments);
122  }

Member Data Documentation

◆ correct_fragments

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

Definition at line 125 of file ambigs.h.

◆ correct_ngram_id

UNICHAR_ID tesseract::AmbigSpec::correct_ngram_id

Definition at line 126 of file ambigs.h.

◆ type

AmbigType tesseract::AmbigSpec::type

Definition at line 127 of file ambigs.h.

◆ wrong_ngram

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

Definition at line 124 of file ambigs.h.

◆ wrong_ngram_size

int tesseract::AmbigSpec::wrong_ngram_size

Definition at line 128 of file ambigs.h.


The documentation for this class was generated from the following files:
tesseract::AmbigSpec::wrong_ngram
UNICHAR_ID wrong_ngram[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:124
tesseract::NOT_AMBIG
Definition: ambigs.h:38
tesseract::AmbigSpec::correct_fragments
UNICHAR_ID correct_fragments[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:125
tesseract::AmbigSpec::correct_ngram_id
UNICHAR_ID correct_ngram_id
Definition: ambigs.h:126
tesseract::AmbigSpec::AmbigSpec
AmbigSpec()
Definition: ambigs.cpp:43
tesseract::AmbigSpec::wrong_ngram_size
int wrong_ngram_size
Definition: ambigs.h:128
tesseract::UnicharIdArrayUtils::compare
static int compare(const UNICHAR_ID *ptr1, const UNICHAR_ID *ptr2)
Definition: ambigs.h:55
tesseract::AmbigSpec::type
AmbigType type
Definition: ambigs.h:127