tesseract  5.0.0
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 95 of file recodebeam.h.

Constructor & Destructor Documentation

◆ RecodeNode() [1/3]

tesseract::RecodeNode::RecodeNode ( )
inline

Definition at line 96 of file recodebeam.h.

97  : code(-1)
98  , unichar_id(INVALID_UNICHAR_ID)
100  , start_of_dawg(false)
101  , start_of_word(false)
102  , end_of_word(false)
103  , duplicate(false)
104  , certainty(0.0f)
105  , score(0.0f)
106  , prev(nullptr)
107  , dawgs(nullptr)
108  , code_hash(0) {}
@ TOP_CHOICE_PERM
Definition: ratngs.h:234
const RecodeNode * prev
Definition: recodebeam.h:172
DawgPositionVector * dawgs
Definition: recodebeam.h:174
PermuterType permuter
Definition: recodebeam.h:152

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

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

◆ RecodeNode() [3/3]

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

Definition at line 129 of file recodebeam.h.

129  : dawgs(nullptr) {
130  *this = src;
131  ASSERT_HOST(src.dawgs == nullptr);
132  }
#define ASSERT_HOST(x)
Definition: errcode.h:59

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 139 of file recodebeam.h.

139  {
140  delete dawgs;
141  }

Member Function Documentation

◆ operator=()

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

Definition at line 133 of file recodebeam.h.

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

◆ Print()

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

Definition at line 44 of file recodebeam.cpp.

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

Member Data Documentation

◆ certainty

float tesseract::RecodeNode::certainty

Definition at line 168 of file recodebeam.h.

◆ code

int tesseract::RecodeNode::code

Definition at line 146 of file recodebeam.h.

◆ code_hash

uint64_t tesseract::RecodeNode::code_hash

Definition at line 177 of file recodebeam.h.

◆ dawgs

DawgPositionVector* tesseract::RecodeNode::dawgs

Definition at line 174 of file recodebeam.h.

◆ duplicate

bool tesseract::RecodeNode::duplicate

Definition at line 166 of file recodebeam.h.

◆ end_of_word

bool tesseract::RecodeNode::end_of_word

Definition at line 161 of file recodebeam.h.

◆ permuter

PermuterType tesseract::RecodeNode::permuter

Definition at line 152 of file recodebeam.h.

◆ prev

const RecodeNode* tesseract::RecodeNode::prev

Definition at line 172 of file recodebeam.h.

◆ score

float tesseract::RecodeNode::score

Definition at line 170 of file recodebeam.h.

◆ start_of_dawg

bool tesseract::RecodeNode::start_of_dawg

Definition at line 155 of file recodebeam.h.

◆ start_of_word

bool tesseract::RecodeNode::start_of_word

Definition at line 157 of file recodebeam.h.

◆ unichar_id

int tesseract::RecodeNode::unichar_id

Definition at line 148 of file recodebeam.h.


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