#include <word_altlist.h>
Definition at line 32 of file word_altlist.h.
tesseract::WordAltList::WordAltList |
( |
int |
max_alt | ) |
|
|
explicit |
tesseract::WordAltList::~WordAltList |
( |
| ) |
|
Definition at line 28 of file word_altlist.cpp.
29 if (word_alt_ !=
NULL) {
30 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
31 if (word_alt_[alt_idx] !=
NULL) {
32 delete []word_alt_[alt_idx];
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.
54 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
70 if (word_alt_[alt_cnt_] ==
NULL) {
75 memcpy(word_alt_[alt_cnt_], word_str, len *
sizeof(*word_str));
static int StrLen(const char_32 *str)
static int StrCmp(const char_32 *str1, const char_32 *str2)
void tesseract::WordAltList::PrintDebug |
( |
| ) |
|
Definition at line 108 of file word_altlist.cpp.
109 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
110 char_32 *word_32 = word_alt_[alt_idx];
114 fprintf(stderr,
"Alt[%d]=%s (cost=%d, num_unichars=%d); unichars=", alt_idx,
115 word_str.c_str(),
alt_cost_[alt_idx], num_unichars);
116 for (
int i = 0; i < num_unichars; ++i)
117 fprintf(stderr,
"%d ", word_32[i]);
118 fprintf(stderr,
"\n");
static int StrLen(const char_32 *str)
static void UTF32ToUTF8(const char_32 *utf32_str, string *str)
void tesseract::WordAltList::Sort |
( |
| ) |
|
|
virtual |
Implements tesseract::AltList.
Definition at line 88 of file word_altlist.cpp.
89 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
90 for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
92 char_32 *pchTemp = word_alt_[alt_idx];
93 word_alt_[alt_idx] = word_alt_[alt];
94 word_alt_[alt] = pchTemp;
The documentation for this class was generated from the following files: