#include <word_list_lang_model.h>
List of all members.
Detailed Description
Definition at line 39 of file word_list_lang_model.h.
Constructor & Destructor Documentation
tesseract::WordListLangModel::~WordListLangModel |
( |
| ) |
|
Member Function Documentation
bool tesseract::WordListLangModel::AddString |
( |
const char * |
char_ptr | ) |
|
Definition at line 167 of file word_list_lang_model.cpp.
{
if (!init_ && !Init()) {
return false;
}
if (str32.length() < 1) {
return false;
}
}
bool tesseract::WordListLangModel::AddString32 |
( |
const char_32 * |
char_32_ptr | ) |
|
Definition at line 181 of file word_list_lang_model.cpp.
{
if (char_32_ptr ==
NULL) {
return false;
}
vector<WERD_CHOICE *> word_variants;
char_32_ptr, &word_variants);
if (word_variants.size() > 0) {
int shortest_word = 0;
for (int word = 1; word < word_variants.size(); word++) {
if (word_variants[shortest_word]->length() >
word_variants[word]->length()) {
shortest_word = word;
}
}
}
for (int i = 0; i < word_variants.size(); i++) { delete word_variants[i]; }
return true;
}
Implements tesseract::LangModel.
Definition at line 71 of file word_list_lang_model.cpp.
{
if (init_ == false) {
if (Init() == false) {
return false;
}
}
(*edge_cnt) = 0;
TessLangModEdge *tess_lm_edge = reinterpret_cast<TessLangModEdge *>(edge);
if (tess_lm_edge ==
NULL) {
edge_ref = 0;
} else {
edge_ref = tess_lm_edge->EndEdge();
if (edge_ref == 0) {
return 0;
}
}
LangModEdge **edge_array = new LangModEdge *[kMaxEdge];
if (edge_array ==
NULL) {
}
edge_array + (*edge_cnt));
return edge_array;
}
bool tesseract::WordListLangModel::IsDigit |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
bool tesseract::WordListLangModel::IsLeadingPunc |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
bool tesseract::WordListLangModel::IsTrailingPunc |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
bool tesseract::WordListLangModel::IsValidSequence |
( |
const char_32 * |
sequence, |
|
|
bool |
eow_flag, |
|
|
LangModEdge ** |
edges |
|
) |
| |
|
virtual |
Definition at line 154 of file word_list_lang_model.cpp.
{
for (int i = 0; i < word_variants->size(); i++) {
delete (*word_variants)[i];
}
word_variants->clear();
WordVariants(char_set, prefix_str32, &word_so_far, str32, word_variants);
}
The documentation for this class was generated from the following files: