#include <char_altlist.h>
List of all members.
Detailed Description
Definition at line 32 of file char_altlist.h.
Constructor & Destructor Documentation
tesseract::CharAltList::CharAltList |
( |
const CharSet * |
char_set, |
|
|
int |
max_alt = kMaxCharAlt |
|
) |
| |
tesseract::CharAltList::~CharAltList |
( |
| ) |
|
Definition at line 34 of file char_altlist.cpp.
{
if (class_id_alt_ !=
NULL) {
delete []class_id_alt_;
}
if (class_id_cost_ !=
NULL) {
delete []class_id_cost_;
}
}
Member Function Documentation
int tesseract::CharAltList::Alt |
( |
int |
alt_idx | ) |
const |
|
inline |
Definition at line 51 of file char_altlist.h.
{ return class_id_alt_[alt_idx]; }
int tesseract::CharAltList::ClassCost |
( |
int |
class_id | ) |
const |
|
inline |
Definition at line 42 of file char_altlist.h.
{
if (class_id_cost_ ==
NULL ||
class_id < 0 ||
}
return class_id_cost_[class_id];
}
bool tesseract::CharAltList::Insert |
( |
int |
class_id, |
|
|
int |
cost, |
|
|
void * |
tag = NULL |
|
) |
| |
Definition at line 47 of file char_altlist.cpp.
{
if (class_id < 0 || class_id >= char_set_->
ClassCount()) {
return false;
}
return false;
}
}
if (class_id_cost_ ==
NULL) {
class_id_cost_ = new int[class_cnt];
if (class_id_cost_ ==
NULL) {
return false;
}
for (int ich = 0; ich < class_cnt; ich++) {
}
}
if (class_id < 0 || class_id >= char_set_->
ClassCount()) {
return false;
}
class_id_cost_[class_id] = cost;
return true;
}
void tesseract::CharAltList::SetAltCost |
( |
int |
alt_idx, |
|
|
int |
cost |
|
) |
| |
|
inline |
Definition at line 53 of file char_altlist.h.
{
class_id_cost_[class_id_alt_[alt_idx]] = cost;
}
void tesseract::CharAltList::Sort |
( |
| ) |
|
|
virtual |
Implements tesseract::AltList.
Definition at line 96 of file char_altlist.cpp.
{
for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
int temp = class_id_alt_[alt_idx];
class_id_alt_[alt_idx] = class_id_alt_[alt];
class_id_alt_[alt] = temp;
}
}
}
}
The documentation for this class was generated from the following files: