tesseract v5.3.3.20231005
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 (const RecodeNode &src)
 
RecodeNodeoperator= (const 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 92 of file recodebeam.h.

Constructor & Destructor Documentation

◆ RecodeNode() [1/3]

tesseract::RecodeNode::RecodeNode ( )
inline

Definition at line 93 of file recodebeam.h.

94 : code(-1)
95 , unichar_id(INVALID_UNICHAR_ID)
97 , start_of_dawg(false)
98 , start_of_word(false)
99 , end_of_word(false)
100 , duplicate(false)
101 , certainty(0.0f)
102 , score(0.0f)
103 , prev(nullptr)
104 , dawgs(nullptr)
105 , code_hash(0) {}
@ TOP_CHOICE_PERM
Definition: ratngs.h:238
const RecodeNode * prev
Definition: recodebeam.h:169
DawgPositionVector * dawgs
Definition: recodebeam.h:171
PermuterType permuter
Definition: recodebeam.h:149

◆ 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 106 of file recodebeam.h.

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

◆ RecodeNode() [3/3]

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

Definition at line 126 of file recodebeam.h.

126 : dawgs(nullptr) {
127 *this = src;
128 ASSERT_HOST(src.dawgs == nullptr);
129 }
#define ASSERT_HOST(x)
Definition: errcode.h:54

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 136 of file recodebeam.h.

136 {
137 delete dawgs;
138 }

Member Function Documentation

◆ operator=()

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

Definition at line 130 of file recodebeam.h.

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

◆ Print()

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

Definition at line 38 of file recodebeam.cpp.

39 {
40 if (code == null_char) {
41 tprintf("null_char");
42 } else {
43 tprintf("label=%d, uid=%d=%s", code, unichar_id,
44 unicharset.debug_str(unichar_id).c_str());
45 }
46 tprintf(" score=%g, c=%g,%s%s%s perm=%d, hash=%" PRIx64, score, certainty,
47 start_of_dawg ? " DawgStart" : "", start_of_word ? " Start" : "",
48 end_of_word ? " End" : "", permuter, code_hash);
49 if (depth > 0 && prev != nullptr) {
50 tprintf(" prev:");
51 prev->Print(null_char, unicharset, depth - 1);
52 } else {
53 tprintf("\n");
54 }
55}
void tprintf(const char *format,...)
Definition: tprintf.cpp:41
void Print(int null_char, const UNICHARSET &unicharset, int depth) const
Definition: recodebeam.cpp:38

Member Data Documentation

◆ certainty

float tesseract::RecodeNode::certainty

Definition at line 165 of file recodebeam.h.

◆ code

int tesseract::RecodeNode::code

Definition at line 143 of file recodebeam.h.

◆ code_hash

uint64_t tesseract::RecodeNode::code_hash

Definition at line 174 of file recodebeam.h.

◆ dawgs

DawgPositionVector* tesseract::RecodeNode::dawgs

Definition at line 171 of file recodebeam.h.

◆ duplicate

bool tesseract::RecodeNode::duplicate

Definition at line 163 of file recodebeam.h.

◆ end_of_word

bool tesseract::RecodeNode::end_of_word

Definition at line 158 of file recodebeam.h.

◆ permuter

PermuterType tesseract::RecodeNode::permuter

Definition at line 149 of file recodebeam.h.

◆ prev

const RecodeNode* tesseract::RecodeNode::prev

Definition at line 169 of file recodebeam.h.

◆ score

float tesseract::RecodeNode::score

Definition at line 167 of file recodebeam.h.

◆ start_of_dawg

bool tesseract::RecodeNode::start_of_dawg

Definition at line 152 of file recodebeam.h.

◆ start_of_word

bool tesseract::RecodeNode::start_of_word

Definition at line 154 of file recodebeam.h.

◆ unichar_id

int tesseract::RecodeNode::unichar_id

Definition at line 145 of file recodebeam.h.


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