tesseract  4.00.00dev
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 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 code_hash
 

Detailed Description

Definition at line 89 of file recodebeam.h.

Constructor & Destructor Documentation

◆ RecodeNode() [1/3]

tesseract::RecodeNode::RecodeNode ( )
inline

Definition at line 90 of file recodebeam.h.

91  : code(-1),
92  unichar_id(INVALID_UNICHAR_ID),
94  start_of_dawg(false),
95  start_of_word(false),
96  end_of_word(false),
97  duplicate(false),
98  certainty(0.0f),
99  score(0.0f),
100  prev(NULL),
101  dawgs(NULL),
102  code_hash(0) {}
const RecodeNode * prev
Definition: recodebeam.h:164
PermuterType permuter
Definition: recodebeam.h:144
DawgPositionVector * dawgs
Definition: recodebeam.h:166

◆ 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  hash 
)
inline

Definition at line 103 of file recodebeam.h.

106  : code(c),
107  unichar_id(uni_id),
108  permuter(perm),
109  start_of_dawg(dawg_start),
110  start_of_word(word_start),
111  end_of_word(end),
112  duplicate(dup),
113  certainty(cert),
114  score(s),
115  prev(p),
116  dawgs(d),
117  code_hash(hash) {}
const RecodeNode * prev
Definition: recodebeam.h:164
PermuterType permuter
Definition: recodebeam.h:144
DawgPositionVector * dawgs
Definition: recodebeam.h:166

◆ RecodeNode() [3/3]

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

Definition at line 123 of file recodebeam.h.

123  : dawgs(NULL) {
124  *this = src;
125  ASSERT_HOST(src.dawgs == NULL);
126  }
#define ASSERT_HOST(x)
Definition: errcode.h:84
DawgPositionVector * dawgs
Definition: recodebeam.h:166

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 133 of file recodebeam.h.

133 { delete dawgs; }
DawgPositionVector * dawgs
Definition: recodebeam.h:166

Member Function Documentation

◆ operator=()

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

Definition at line 127 of file recodebeam.h.

127  {
128  delete dawgs;
129  memcpy(this, &src, sizeof(src));
130  src.dawgs = NULL;
131  return *this;
132  }
DawgPositionVector * dawgs
Definition: recodebeam.h:166

◆ 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=%lx", 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 }
void Print(int null_char, const UNICHARSET &unicharset, int depth) const
Definition: recodebeam.cpp:42
#define tprintf(...)
Definition: tprintf.h:31
const char * string() const
Definition: strngs.cpp:198
const RecodeNode * prev
Definition: recodebeam.h:164
PermuterType permuter
Definition: recodebeam.h:144
STRING debug_str(UNICHAR_ID id) const
Definition: unicharset.cpp:318

Member Data Documentation

◆ certainty

float tesseract::RecodeNode::certainty

Definition at line 160 of file recodebeam.h.

◆ code

int tesseract::RecodeNode::code

Definition at line 138 of file recodebeam.h.

◆ code_hash

uinT64 tesseract::RecodeNode::code_hash

Definition at line 169 of file recodebeam.h.

◆ dawgs

DawgPositionVector* tesseract::RecodeNode::dawgs

Definition at line 166 of file recodebeam.h.

◆ duplicate

bool tesseract::RecodeNode::duplicate

Definition at line 158 of file recodebeam.h.

◆ end_of_word

bool tesseract::RecodeNode::end_of_word

Definition at line 153 of file recodebeam.h.

◆ permuter

PermuterType tesseract::RecodeNode::permuter

Definition at line 144 of file recodebeam.h.

◆ prev

const RecodeNode* tesseract::RecodeNode::prev

Definition at line 164 of file recodebeam.h.

◆ score

float tesseract::RecodeNode::score

Definition at line 162 of file recodebeam.h.

◆ start_of_dawg

bool tesseract::RecodeNode::start_of_dawg

Definition at line 147 of file recodebeam.h.

◆ start_of_word

bool tesseract::RecodeNode::start_of_word

Definition at line 149 of file recodebeam.h.

◆ unichar_id

int tesseract::RecodeNode::unichar_id

Definition at line 140 of file recodebeam.h.


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