tesseract  4.00.00dev
tesseract::AmbigSpec Class Reference

#include <ambigs.h>

Inheritance diagram for tesseract::AmbigSpec:
ELIST_LINK

Public Member Functions

 AmbigSpec ()
 
 ~AmbigSpec ()
 
- 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 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;
46  type = NOT_AMBIG;
47  wrong_ngram_size = 0;
48 }
UNICHAR_ID correct_fragments[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:134
AmbigType type
Definition: ambigs.h:136
UNICHAR_ID wrong_ngram[MAX_AMBIG_SIZE+1]
Definition: ambigs.h:133
UNICHAR_ID correct_ngram_id
Definition: ambigs.h:135

◆ ~AmbigSpec()

tesseract::AmbigSpec::~AmbigSpec ( )
inline

Definition at line 117 of file ambigs.h.

117 {}

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 =
124  *static_cast<const AmbigSpec * const *>(spec1);
125  const AmbigSpec *s2 =
126  *static_cast<const AmbigSpec * const *>(spec2);
127  int result = UnicharIdArrayUtils::compare(s1->wrong_ngram, s2->wrong_ngram);
128  if (result != 0) return result;
129  return UnicharIdArrayUtils::compare(s1->correct_fragments,
130  s2->correct_fragments);
131  }
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 134 of file ambigs.h.

◆ correct_ngram_id

UNICHAR_ID tesseract::AmbigSpec::correct_ngram_id

Definition at line 135 of file ambigs.h.

◆ type

AmbigType tesseract::AmbigSpec::type

Definition at line 136 of file ambigs.h.

◆ wrong_ngram

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

Definition at line 133 of file ambigs.h.

◆ wrong_ngram_size

int tesseract::AmbigSpec::wrong_ngram_size

Definition at line 137 of file ambigs.h.


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