#include <word_altlist.h>
List of all members.
Detailed Description
Definition at line 32 of file word_altlist.h.
Constructor & Destructor Documentation
tesseract::WordAltList::WordAltList |
( |
int |
max_alt | ) |
|
|
explicit |
tesseract::WordAltList::~WordAltList |
( |
| ) |
|
Definition at line 28 of file word_altlist.cpp.
{
for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
if (word_alt_[alt_idx] !=
NULL) {
delete []word_alt_[alt_idx];
}
}
delete []word_alt_;
}
}
Member Function Documentation
char_32* tesseract::WordAltList::Alt |
( |
int |
alt_idx | ) |
|
|
inline |
bool tesseract::WordAltList::Insert |
( |
char_32 * |
char_ptr, |
|
|
int |
cost, |
|
|
void * |
tag = NULL |
|
) |
| |
Definition at line 41 of file word_altlist.cpp.
{
return false;
}
} else {
for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
}
return true;
}
}
}
if (word_alt_[alt_cnt_] ==
NULL) {
return false;
}
if (len > 0) {
memcpy(word_alt_[alt_cnt_], word_str, len * sizeof(*word_str));
}
alt_cnt_++;
return true;
}
void tesseract::WordAltList::PrintDebug |
( |
| ) |
|
Definition at line 108 of file word_altlist.cpp.
{
for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
char_32 *word_32 = word_alt_[alt_idx];
string word_str;
fprintf(stderr, "Alt[%d]=%s (cost=%d, num_unichars=%d); unichars=", alt_idx,
word_str.c_str(),
alt_cost_[alt_idx], num_unichars);
for (int i = 0; i < num_unichars; ++i)
fprintf(stderr, "%d ", word_32[i]);
fprintf(stderr, "\n");
}
}
void tesseract::WordAltList::Sort |
( |
| ) |
|
|
virtual |
Implements tesseract::AltList.
Definition at line 88 of file word_altlist.cpp.
{
for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
char_32 *pchTemp = word_alt_[alt_idx];
word_alt_[alt_idx] = word_alt_[alt];
word_alt_[alt] = pchTemp;
}
}
}
}
The documentation for this class was generated from the following files: