#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 167 of file word_list_lang_model.cpp.
168 if (!init_ && !Init()) {
174 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 181 of file word_list_lang_model.cpp.
182 if (char_32_ptr ==
NULL) {
186 vector<WERD_CHOICE *> word_variants;
188 char_32_ptr, &word_variants);
190 if (word_variants.size() > 0) {
192 int shortest_word = 0;
193 for (
int word = 1; word < word_variants.size(); word++) {
194 if (word_variants[shortest_word]->length() >
195 word_variants[word]->length()) {
196 shortest_word = word;
202 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)
static void WordVariants(const CharSet &char_set, const UNICHARSET *uchset, string_32 str32, vector< WERD_CHOICE * > *word_variants)
CharSet * CharacterSet() const
const UNICHARSET * TessUnicharset() const
Implements tesseract::LangModel.
Definition at line 71 of file word_list_lang_model.cpp.
76 if (Init() ==
false) {
85 TessLangModEdge *tess_lm_edge =
reinterpret_cast<TessLangModEdge *
>(edge);
87 if (tess_lm_edge ==
NULL) {
90 edge_ref = tess_lm_edge->EndEdge();
100 LangModEdge **edge_array =
new LangModEdge *[kMaxEdge];
101 if (edge_array ==
NULL) {
107 edge_array + (*edge_cnt));
NODE_REF next_node(EDGE_REF edge_ref) const
static int CreateChildren(CubeRecoContext *cntxt, const Dawg *edges, NODE_REF edge_reg, LangModEdge **lm_edges)
| 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.
157 for (
int i = 0; i < word_variants->size(); i++) {
158 delete (*word_variants)[i];
160 word_variants->clear();
163 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: