#include <char_altlist.h>
Definition at line 32 of file char_altlist.h.
◆ CharAltList()
tesseract::CharAltList::CharAltList |
( |
const CharSet * |
char_set, |
|
|
int |
max_alt = kMaxCharAlt |
|
) |
| |
◆ ~CharAltList()
tesseract::CharAltList::~CharAltList |
( |
| ) |
|
Definition at line 34 of file char_altlist.cpp.
35 if (class_id_alt_ != NULL) {
36 delete []class_id_alt_;
40 if (class_id_cost_ != NULL) {
41 delete []class_id_cost_;
42 class_id_cost_ = NULL;
◆ Alt()
int tesseract::CharAltList::Alt |
( |
int |
alt_idx | ) |
const |
|
inline |
Definition at line 51 of file char_altlist.h.
51 {
return class_id_alt_[alt_idx]; }
◆ ClassCost()
int tesseract::CharAltList::ClassCost |
( |
int |
class_id | ) |
const |
|
inline |
Definition at line 42 of file char_altlist.h.
43 if (class_id_cost_ == NULL ||
48 return class_id_cost_[class_id];
◆ Insert()
bool tesseract::CharAltList::Insert |
( |
int |
class_id, |
|
|
int |
cost, |
|
|
void * |
tag = NULL |
|
) |
| |
Definition at line 47 of file char_altlist.cpp.
49 if (class_id < 0 || class_id >= char_set_->
ClassCount()) {
54 if (class_id_alt_ == NULL ||
alt_cost_ == NULL) {
62 if (class_id_cost_ == NULL) {
65 class_id_cost_ =
new int[class_cnt];
67 for (
int ich = 0; ich < class_cnt; ich++) {
72 if (class_id < 0 || class_id >= char_set_->
ClassCount()) {
83 class_id_cost_[class_id] = cost;
◆ SetAltCost()
void tesseract::CharAltList::SetAltCost |
( |
int |
alt_idx, |
|
|
int |
cost |
|
) |
| |
|
inline |
Definition at line 53 of file char_altlist.h.
55 class_id_cost_[class_id_alt_[alt_idx]] = cost;
◆ Sort()
void tesseract::CharAltList::Sort |
( |
| ) |
|
|
virtual |
Implements tesseract::AltList.
Definition at line 89 of file char_altlist.cpp.
90 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
91 for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
93 int temp = class_id_alt_[alt_idx];
94 class_id_alt_[alt_idx] = class_id_alt_[alt];
95 class_id_alt_[alt] = temp;
The documentation for this class was generated from the following files: