#include <word_list_lang_model.h>
Definition at line 39 of file word_list_lang_model.h.
tesseract::WordListLangModel::~WordListLangModel |
( |
| ) |
|
bool tesseract::WordListLangModel::AddString |
( |
const char * |
char_ptr | ) |
|
Definition at line 166 of file word_list_lang_model.cpp.
167 if (!init_ && !Init()) {
173 if (str32.length() < 1) {
bool AddString32(const char_32 *char_32_ptr)
basic_string< char_32 > string_32
static void UTF8ToUTF32(const char *utf8_str, string_32 *str32)
bool tesseract::WordListLangModel::AddString32 |
( |
const char_32 * |
char_32_ptr | ) |
|
Definition at line 180 of file word_list_lang_model.cpp.
181 if (char_32_ptr ==
NULL) {
185 vector<WERD_CHOICE *> word_variants;
187 char_32_ptr, &word_variants);
189 if (word_variants.size() > 0) {
191 int shortest_word = 0;
192 for (
int word = 1; word < word_variants.size(); word++) {
193 if (word_variants[shortest_word]->length() >
194 word_variants[word]->length()) {
195 shortest_word = word;
201 for (
int i = 0; i < word_variants.size(); i++) {
delete word_variants[i]; }
bool add_word_to_dawg(const WERD_CHOICE &word, const GenericVector< bool > *repetitions)
const UNICHARSET * TessUnicharset() const
static void WordVariants(const CharSet &char_set, const UNICHARSET *uchset, string_32 str32, vector< WERD_CHOICE * > *word_variants)
CharSet * CharacterSet() const
Implements tesseract::LangModel.
Definition at line 70 of file word_list_lang_model.cpp.
75 if (Init() ==
false) {
84 TessLangModEdge *tess_lm_edge =
reinterpret_cast<TessLangModEdge *
>(edge);
86 if (tess_lm_edge ==
NULL) {
89 edge_ref = tess_lm_edge->EndEdge();
99 LangModEdge **edge_array =
new LangModEdge *[kMaxEdge];
100 if (edge_array ==
NULL) {
106 edge_array + (*edge_cnt));
static int CreateChildren(CubeRecoContext *cntxt, const Dawg *edges, NODE_REF edge_reg, LangModEdge **lm_edges)
NODE_REF next_node(EDGE_REF edge_ref) const
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 153 of file word_list_lang_model.cpp.
156 for (
int i = 0; i < word_variants->size(); i++) {
157 delete (*word_variants)[i];
159 word_variants->clear();
162 WordVariants(char_set, prefix_str32, &word_so_far, str32, word_variants);
basic_string< char_32 > string_32
static void WordVariants(const CharSet &char_set, const UNICHARSET *uchset, string_32 str32, vector< WERD_CHOICE * > *word_variants)
The documentation for this class was generated from the following files: