tesseract  5.0.0-alpha-619-ge9db
tesseract::RecodeNode Struct Reference

#include <recodebeam.h>

Public Member Functions

 RecodeNode ()
 
 RecodeNode (int c, int uni_id, PermuterType perm, bool dawg_start, bool word_start, bool end, bool dup, float cert, float s, const RecodeNode *p, DawgPositionVector *d, uint64_t hash)
 
 RecodeNode (RecodeNode &src)
 
RecodeNodeoperator= (RecodeNode &src)
 
 ~RecodeNode ()
 
void Print (int null_char, const UNICHARSET &unicharset, int depth) const
 

Public Attributes

int code
 
int unichar_id
 
PermuterType permuter
 
bool start_of_dawg
 
bool start_of_word
 
bool end_of_word
 
bool duplicate
 
float certainty
 
float score
 
const RecodeNodeprev
 
DawgPositionVectordawgs
 
uint64_t code_hash
 

Detailed Description

Definition at line 93 of file recodebeam.h.

Constructor & Destructor Documentation

◆ RecodeNode() [1/3]

tesseract::RecodeNode::RecodeNode ( )
inline

Definition at line 94 of file recodebeam.h.

95  : code(-1),
96  unichar_id(INVALID_UNICHAR_ID),
98  start_of_dawg(false),
99  start_of_word(false),
100  end_of_word(false),
101  duplicate(false),
102  certainty(0.0f),
103  score(0.0f),
104  prev(nullptr),
105  dawgs(nullptr),
106  code_hash(0) {}

◆ RecodeNode() [2/3]

tesseract::RecodeNode::RecodeNode ( int  c,
int  uni_id,
PermuterType  perm,
bool  dawg_start,
bool  word_start,
bool  end,
bool  dup,
float  cert,
float  s,
const RecodeNode p,
DawgPositionVector d,
uint64_t  hash 
)
inline

Definition at line 107 of file recodebeam.h.

110  : code(c),
111  unichar_id(uni_id),
112  permuter(perm),
113  start_of_dawg(dawg_start),
114  start_of_word(word_start),
115  end_of_word(end),
116  duplicate(dup),
117  certainty(cert),
118  score(s),
119  prev(p),
120  dawgs(d),
121  code_hash(hash) {}

◆ RecodeNode() [3/3]

tesseract::RecodeNode::RecodeNode ( RecodeNode src)
inline

Definition at line 127 of file recodebeam.h.

127  : dawgs(nullptr) {
128  *this = src;
129  ASSERT_HOST(src.dawgs == nullptr);
130  }

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 137 of file recodebeam.h.

137 { delete dawgs; }

Member Function Documentation

◆ operator=()

RecodeNode& tesseract::RecodeNode::operator= ( RecodeNode src)
inline

Definition at line 131 of file recodebeam.h.

131  {
132  delete dawgs;
133  memcpy(this, &src, sizeof(src));
134  src.dawgs = nullptr;
135  return *this;
136  }

◆ Print()

void tesseract::RecodeNode::Print ( int  null_char,
const UNICHARSET unicharset,
int  depth 
) const

Definition at line 43 of file recodebeam.cpp.

44  {
45  if (code == null_char) {
46  tprintf("null_char");
47  } else {
48  tprintf("label=%d, uid=%d=%s", code, unichar_id,
49  unicharset.debug_str(unichar_id).c_str());
50  }
51  tprintf(" score=%g, c=%g,%s%s%s perm=%d, hash=%" PRIx64, score, certainty,
52  start_of_dawg ? " DawgStart" : "", start_of_word ? " Start" : "",
53  end_of_word ? " End" : "", permuter, code_hash);
54  if (depth > 0 && prev != nullptr) {
55  tprintf(" prev:");
56  prev->Print(null_char, unicharset, depth - 1);
57  } else {
58  tprintf("\n");
59  }
60 }

Member Data Documentation

◆ certainty

float tesseract::RecodeNode::certainty

Definition at line 164 of file recodebeam.h.

◆ code

int tesseract::RecodeNode::code

Definition at line 142 of file recodebeam.h.

◆ code_hash

uint64_t tesseract::RecodeNode::code_hash

Definition at line 173 of file recodebeam.h.

◆ dawgs

DawgPositionVector* tesseract::RecodeNode::dawgs

Definition at line 170 of file recodebeam.h.

◆ duplicate

bool tesseract::RecodeNode::duplicate

Definition at line 162 of file recodebeam.h.

◆ end_of_word

bool tesseract::RecodeNode::end_of_word

Definition at line 157 of file recodebeam.h.

◆ permuter

PermuterType tesseract::RecodeNode::permuter

Definition at line 148 of file recodebeam.h.

◆ prev

const RecodeNode* tesseract::RecodeNode::prev

Definition at line 168 of file recodebeam.h.

◆ score

float tesseract::RecodeNode::score

Definition at line 166 of file recodebeam.h.

◆ start_of_dawg

bool tesseract::RecodeNode::start_of_dawg

Definition at line 151 of file recodebeam.h.

◆ start_of_word

bool tesseract::RecodeNode::start_of_word

Definition at line 153 of file recodebeam.h.

◆ unichar_id

int tesseract::RecodeNode::unichar_id

Definition at line 144 of file recodebeam.h.


The documentation for this struct was generated from the following files:
tesseract::RecodeNode::unichar_id
int unichar_id
Definition: recodebeam.h:144
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:87
tesseract::RecodeNode::start_of_dawg
bool start_of_dawg
Definition: recodebeam.h:151
tesseract::RecodeNode::prev
const RecodeNode * prev
Definition: recodebeam.h:168
tesseract::RecodeNode::score
float score
Definition: recodebeam.h:166
tesseract::RecodeNode::duplicate
bool duplicate
Definition: recodebeam.h:162
UNICHARSET::debug_str
STRING debug_str(UNICHAR_ID id) const
Definition: unicharset.cpp:342
tesseract::RecodeNode::code_hash
uint64_t code_hash
Definition: recodebeam.h:173
STRING::c_str
const char * c_str() const
Definition: strngs.cpp:192
tesseract::RecodeNode::dawgs
DawgPositionVector * dawgs
Definition: recodebeam.h:170
TOP_CHOICE_PERM
Definition: ratngs.h:233
tesseract::RecodeNode::start_of_word
bool start_of_word
Definition: recodebeam.h:153
tesseract::RecodeNode::certainty
float certainty
Definition: recodebeam.h:164
tesseract::RecodeNode::end_of_word
bool end_of_word
Definition: recodebeam.h:157
tesseract::RecodeNode::permuter
PermuterType permuter
Definition: recodebeam.h:148
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
tesseract::RecodeNode::Print
void Print(int null_char, const UNICHARSET &unicharset, int depth) const
Definition: recodebeam.cpp:43
tesseract::RecodeNode::code
int code
Definition: recodebeam.h:142