#include <word_list_lang_model.h>
Definition at line 39 of file word_list_lang_model.h.
◆ WordListLangModel()
◆ ~WordListLangModel()
tesseract::WordListLangModel::~WordListLangModel |
( |
| ) |
|
◆ AddString()
bool tesseract::WordListLangModel::AddString |
( |
const char * |
char_ptr | ) |
|
Definition at line 160 of file word_list_lang_model.cpp.
161 if (!init_ && !Init()) {
167 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)
◆ AddString32()
bool tesseract::WordListLangModel::AddString32 |
( |
const char_32 * |
char_32_ptr | ) |
|
Definition at line 174 of file word_list_lang_model.cpp.
175 if (char_32_ptr == NULL) {
179 vector<WERD_CHOICE *> word_variants;
181 char_32_ptr, &word_variants);
183 if (word_variants.size() > 0) {
185 int shortest_word = 0;
186 for (
int word = 1; word < word_variants.size(); word++) {
187 if (word_variants[shortest_word]->length() >
188 word_variants[word]->length()) {
189 shortest_word = word;
195 for (
int i = 0; i < word_variants.size(); i++) {
delete word_variants[i]; }
const UNICHARSET * TessUnicharset() const
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
◆ GetEdges()
Implements tesseract::LangModel.
Definition at line 67 of file word_list_lang_model.cpp.
72 if (Init() ==
false) {
81 TessLangModEdge *tess_lm_edge =
reinterpret_cast<TessLangModEdge *
>(edge);
83 if (tess_lm_edge == NULL) {
86 edge_ref = tess_lm_edge->EndEdge();
96 LangModEdge **edge_array =
new LangModEdge *[kMaxEdge];
100 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)
◆ IsDigit()
bool tesseract::WordListLangModel::IsDigit |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
◆ IsLeadingPunc()
bool tesseract::WordListLangModel::IsLeadingPunc |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
◆ IsTrailingPunc()
bool tesseract::WordListLangModel::IsTrailingPunc |
( |
char_32 |
ch | ) |
|
|
inlinevirtual |
◆ IsValidSequence()
bool tesseract::WordListLangModel::IsValidSequence |
( |
const char_32 * |
sequence, |
|
|
bool |
eow_flag, |
|
|
LangModEdge ** |
edges |
|
) |
| |
|
virtual |
◆ Root()
◆ WordVariants()
Definition at line 147 of file word_list_lang_model.cpp.
150 for (
int i = 0; i < word_variants->size(); i++) {
151 delete (*word_variants)[i];
153 word_variants->clear();
156 WordVariants(char_set, prefix_str32, &word_so_far, str32, word_variants);
static void WordVariants(const CharSet &char_set, const UNICHARSET *uchset, string_32 str32, vector< WERD_CHOICE *> *word_variants)
basic_string< char_32 > string_32
The documentation for this class was generated from the following files: