tesseract  4.0.0-1-g2a2b
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) {}
PermuterType permuter
Definition: recodebeam.h:147
DawgPositionVector * dawgs
Definition: recodebeam.h:169
const RecodeNode * prev
Definition: recodebeam.h:167

◆ 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) {}
PermuterType permuter
Definition: recodebeam.h:147
DawgPositionVector * dawgs
Definition: recodebeam.h:169
const RecodeNode * prev
Definition: recodebeam.h:167

◆ 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  }
DawgPositionVector * dawgs
Definition: recodebeam.h:169
#define ASSERT_HOST(x)
Definition: errcode.h:84

◆ ~RecodeNode()

tesseract::RecodeNode::~RecodeNode ( )
inline

Definition at line 136 of file recodebeam.h.

136 { delete dawgs; }
DawgPositionVector * dawgs
Definition: recodebeam.h:169

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  }
DawgPositionVector * dawgs
Definition: recodebeam.h:169

◆ Print()

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

Definition at line 48 of file recodebeam.cpp.

49  {
50  if (code == null_char) {
51  tprintf("null_char");
52  } else {
53  tprintf("label=%d, uid=%d=%s", code, unichar_id,
54  unicharset.debug_str(unichar_id).string());
55  }
56  tprintf(" score=%g, c=%g,%s%s%s perm=%d, hash=%lx", score, certainty,
57  start_of_dawg ? " DawgStart" : "", start_of_word ? " Start" : "",
58  end_of_word ? " End" : "", permuter, code_hash);
59  if (depth > 0 && prev != nullptr) {
60  tprintf(" prev:");
61  prev->Print(null_char, unicharset, depth - 1);
62  } else {
63  tprintf("\n");
64  }
65 }
const char * string() const
Definition: strngs.cpp:196
PermuterType permuter
Definition: recodebeam.h:147
void Print(int null_char, const UNICHARSET &unicharset, int depth) const
Definition: recodebeam.cpp:48
STRING debug_str(UNICHAR_ID id) const
Definition: unicharset.cpp:342
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:37
const RecodeNode * prev
Definition: recodebeam.h:167

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: