#include <tess_lang_mod_edge.h>
Definition at line 68 of file tess_lang_mod_edge.h.
◆ TessLangModEdge() [1/3]
leading, trailing punc constructor and single byte UTF char
Definition at line 43 of file tess_lang_mod_edge.cpp.
48 start_edge_ = edge_idx;
CharSet * CharacterSet() const
const char_32 * ClassString(int class_id) const
◆ TessLangModEdge() [2/3]
dict constructor: multi byte UTF char
Definition at line 59 of file tess_lang_mod_edge.cpp.
65 start_edge_ = start_edge_idx;
66 end_edge_ = end_edge_idx;
CharSet * CharacterSet() const
const char_32 * ClassString(int class_id) const
◆ TessLangModEdge() [3/3]
tesseract::TessLangModEdge::TessLangModEdge |
( |
CubeRecoContext * |
cntxt, |
|
|
int |
class_id |
|
) |
| |
Definition at line 28 of file tess_lang_mod_edge.cpp.
CharSet * CharacterSet() const
const char_32 * ClassString(int class_id) const
◆ ~TessLangModEdge()
tesseract::TessLangModEdge::~TessLangModEdge |
( |
| ) |
|
|
inline |
◆ ClassID()
int tesseract::TessLangModEdge::ClassID |
( |
| ) |
const |
|
inlinevirtual |
◆ CreateChildren()
Definition at line 105 of file tess_lang_mod_edge.cpp.
111 dawg->unichar_ids_of(parent_node, &vec,
false);
112 for (
int i = 0; i < vec.size(); ++i) {
113 const NodeChild &child = vec[i];
114 if (child.unichar_id == INVALID_UNICHAR_ID)
continue;
115 edge_array[edge_cnt++] =
TessLangModEdge(CubeRecoContext *cntxt, const Dawg *edge_array, EDGE_REF edge, int class_id)
GenericVector< NodeChild > NodeChildVector
◆ Description()
char * tesseract::TessLangModEdge::Description |
( |
| ) |
const |
|
virtual |
Implements tesseract::LangModEdge.
Definition at line 73 of file tess_lang_mod_edge.cpp.
74 char *char_ptr =
new char[256];
79 strcpy(dawg_str,
"OOD");
81 strcpy(dawg_str,
"NUM");
83 strcpy(dawg_str,
"Main");
85 strcpy(dawg_str,
"User");
87 strcpy(dawg_str,
"Doc");
89 strcpy(dawg_str,
"N/A");
92 sprintf(edge_str,
"%d", static_cast<int>(start_edge_));
94 strcat(edge_str,
"-LP");
97 strcat(edge_str,
"-TP");
99 sprintf(char_ptr,
"%s(%s)%s, Wtd Dawg Cost=%d",
100 dawg_str, edge_str,
IsEOW() ?
"-EOW-" :
"", path_cost_);
#define IsLeadingPuncEdge(edge_mask)
#define IsTrailingPuncEdge(edge_mask)
PermuterType permuter() const
◆ EdgeMask()
EDGE_REF tesseract::TessLangModEdge::EdgeMask |
( |
| ) |
const |
|
inline |
◆ EdgeString()
const char_32* tesseract::TessLangModEdge::EdgeString |
( |
| ) |
const |
|
inlinevirtual |
◆ EndEdge()
EDGE_REF tesseract::TessLangModEdge::EndEdge |
( |
| ) |
const |
|
inline |
◆ GetDawg()
const Dawg* tesseract::TessLangModEdge::GetDawg |
( |
| ) |
const |
|
inline |
◆ Hash()
unsigned int tesseract::TessLangModEdge::Hash |
( |
| ) |
const |
|
inlinevirtual |
Implements tesseract::LangModEdge.
Definition at line 178 of file tess_lang_mod_edge.h.
179 return static_cast<unsigned int>(
180 ((start_edge_ | end_edge_) ^ ((reinterpret_cast<uintptr_t>(dawg_)))) ^
181 ((
unsigned int)edge_mask_) ^ class_id_);
◆ IsEOW()
bool tesseract::TessLangModEdge::IsEOW |
( |
| ) |
const |
|
inlinevirtual |
◆ IsIdentical()
bool tesseract::TessLangModEdge::IsIdentical |
( |
LangModEdge * |
lang_mod_edge | ) |
const |
|
inlinevirtual |
Implements tesseract::LangModEdge.
Definition at line 188 of file tess_lang_mod_edge.h.
190 reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->class_id_ &&
191 str_ == reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->str_ &&
192 dawg_ == reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->dawg_ &&
194 reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->start_edge_ &&
196 reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->end_edge_ &&
198 reinterpret_cast<TessLangModEdge *>(lang_mod_edge)->edge_mask_);
◆ IsNumber()
bool tesseract::TessLangModEdge::IsNumber |
( |
| ) |
const |
|
inline |
◆ IsOOD()
bool tesseract::TessLangModEdge::IsOOD |
( |
| ) |
const |
|
inlinevirtual |
◆ IsRoot()
bool tesseract::TessLangModEdge::IsRoot |
( |
| ) |
const |
|
inlinevirtual |
◆ IsTerminal()
bool tesseract::TessLangModEdge::IsTerminal |
( |
| ) |
const |
|
inlinevirtual |
◆ PathCost()
int tesseract::TessLangModEdge::PathCost |
( |
| ) |
const |
|
inlinevirtual |
◆ SetDawg()
void tesseract::TessLangModEdge::SetDawg |
( |
Dawg * |
dawg | ) |
|
|
inline |
◆ SetEdgeMask()
void tesseract::TessLangModEdge::SetEdgeMask |
( |
EDGE_REF |
edge_mask | ) |
|
|
inline |
◆ SetEndEdge()
void tesseract::TessLangModEdge::SetEndEdge |
( |
EDGE_REF |
edge_idx | ) |
|
|
inline |
◆ SetRoot()
void tesseract::TessLangModEdge::SetRoot |
( |
bool |
flag | ) |
|
|
inlinevirtual |
◆ SetSignalWgt()
void tesseract::TessLangModEdge::SetSignalWgt |
( |
int |
signal, |
|
|
double |
wgt |
|
) |
| |
|
inline |
Definition at line 144 of file tess_lang_mod_edge.h.
145 CubeTuningParams *params =
146 reinterpret_cast<CubeTuningParams *
>(cntxt_->
Params());
147 if (params != NULL) {
150 params->SetOODWgt(wgt);
154 params->SetNumWgt(wgt);
TuningParams * Params() const
◆ SetStartEdge()
void tesseract::TessLangModEdge::SetStartEdge |
( |
EDGE_REF |
edge_idx | ) |
|
|
inline |
◆ Signal()
int tesseract::TessLangModEdge::Signal |
( |
int |
signal | ) |
|
|
inline |
◆ SignalCnt()
int tesseract::TessLangModEdge::SignalCnt |
( |
| ) |
const |
|
inline |
◆ SignalWgt()
double tesseract::TessLangModEdge::SignalWgt |
( |
int |
signal | ) |
const |
|
inline |
Definition at line 125 of file tess_lang_mod_edge.h.
126 CubeTuningParams *params =
127 reinterpret_cast<CubeTuningParams *
>(cntxt_->
Params());
128 if (params != NULL) {
131 return params->OODWgt();
135 return params->NumWgt();
TuningParams * Params() const
◆ StartEdge()
EDGE_REF tesseract::TessLangModEdge::StartEdge |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: