tesseract  4.1.1
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 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) {}

◆ 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) {}

◆ RecodeNode() [3/3]

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

Definition at line 126 of file recodebeam.h.

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

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 136 of file recodebeam.h.

136 { delete dawgs; }

Member Function Documentation

◆ operator=()

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

Definition at line 130 of file recodebeam.h.

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

◆ Print()

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

Definition at line 42 of file recodebeam.cpp.

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

Member Data Documentation

◆ certainty

float tesseract::RecodeNode::certainty

Definition at line 163 of file recodebeam.h.

◆ code

int tesseract::RecodeNode::code

Definition at line 141 of file recodebeam.h.

◆ code_hash

uint64_t tesseract::RecodeNode::code_hash

Definition at line 172 of file recodebeam.h.

◆ dawgs

DawgPositionVector* tesseract::RecodeNode::dawgs

Definition at line 169 of file recodebeam.h.

◆ duplicate

bool tesseract::RecodeNode::duplicate

Definition at line 161 of file recodebeam.h.

◆ end_of_word

bool tesseract::RecodeNode::end_of_word

Definition at line 156 of file recodebeam.h.

◆ permuter

PermuterType tesseract::RecodeNode::permuter

Definition at line 147 of file recodebeam.h.

◆ prev

const RecodeNode* tesseract::RecodeNode::prev

Definition at line 167 of file recodebeam.h.

◆ score

float tesseract::RecodeNode::score

Definition at line 165 of file recodebeam.h.

◆ start_of_dawg

bool tesseract::RecodeNode::start_of_dawg

Definition at line 150 of file recodebeam.h.

◆ start_of_word

bool tesseract::RecodeNode::start_of_word

Definition at line 152 of file recodebeam.h.

◆ unichar_id

int tesseract::RecodeNode::unichar_id

Definition at line 143 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:143
tesseract::RecodeNode::end_of_word
bool end_of_word
Definition: recodebeam.h:156
STRING::string
const char * string() const
Definition: strngs.cpp:194
tesseract::RecodeNode::start_of_word
bool start_of_word
Definition: recodebeam.h:152
tesseract::RecodeNode::duplicate
bool duplicate
Definition: recodebeam.h:161
tesseract::RecodeNode::code
int code
Definition: recodebeam.h:141
UNICHARSET::debug_str
STRING debug_str(UNICHAR_ID id) const
Definition: unicharset.cpp:343
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:35
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:88
tesseract::RecodeNode::prev
const RecodeNode * prev
Definition: recodebeam.h:167
tesseract::RecodeNode::certainty
float certainty
Definition: recodebeam.h:163
tesseract::RecodeNode::score
float score
Definition: recodebeam.h:165
TOP_CHOICE_PERM
@ TOP_CHOICE_PERM
Definition: ratngs.h:235
tesseract::RecodeNode::code_hash
uint64_t code_hash
Definition: recodebeam.h:172
tesseract::RecodeNode::permuter
PermuterType permuter
Definition: recodebeam.h:147
tesseract::RecodeNode::start_of_dawg
bool start_of_dawg
Definition: recodebeam.h:150
tesseract::RecodeNode::Print
void Print(int null_char, const UNICHARSET &unicharset, int depth) const
Definition: recodebeam.cpp:42
tesseract::RecodeNode::dawgs
DawgPositionVector * dawgs
Definition: recodebeam.h:169