|
| | WERD_CHOICE (const UNICHARSET *unicharset) |
| |
| | WERD_CHOICE (const UNICHARSET *unicharset, int reserved) |
| |
| | WERD_CHOICE (const char *src_string, const char *src_lengths, float src_rating, float src_certainty, uinT8 src_permuter, const UNICHARSET &unicharset) |
| |
| | WERD_CHOICE (const char *src_string, const UNICHARSET &unicharset) |
| |
| | WERD_CHOICE (const WERD_CHOICE &word) |
| |
| | ~WERD_CHOICE () |
| |
| const UNICHARSET * | unicharset () const |
| |
| int | length () const |
| |
| const UNICHAR_ID * | unichar_ids () const |
| |
| const UNICHAR_ID | unichar_id (int index) const |
| |
| const char * | fragment_lengths () const |
| |
| const char | fragment_length (int index) const |
| |
| float | rating () const |
| |
| float | certainty () const |
| |
| uinT8 | permuter () const |
| |
| const char * | permuter_name () const |
| |
| bool | fragment_mark () const |
| |
| BLOB_CHOICE_LIST_CLIST * | blob_choices () |
| |
| void | set_unichar_id (UNICHAR_ID unichar_id, int index) |
| |
| void | set_fragment_length (char flen, int index) |
| |
| void | set_rating (float new_val) |
| |
| void | set_certainty (float new_val) |
| |
| void | set_permuter (uinT8 perm) |
| |
| void | set_fragment_mark (bool new_fragment_mark) |
| |
| void | set_length (int len) |
| |
| void | set_blob_choices (BLOB_CHOICE_LIST_CLIST *blob_choices) |
| |
| void | double_the_size () |
| | Make more space in unichar_id_ and fragment_lengths_ arrays. More...
|
| |
| void | init (int reserved) |
| |
| void | init (const char *src_string, const char *src_lengths, float src_rating, float src_certainty, uinT8 src_permuter) |
| |
| void | make_bad () |
| | Set the fields in this choice to be default (bad) values. More...
|
| |
| void | append_unichar_id_space_allocated (UNICHAR_ID unichar_id, char fragment_length, float rating, float certainty) |
| |
| void | append_unichar_id (UNICHAR_ID unichar_id, char fragment_length, float rating, float certainty) |
| |
| void | set_unichar_id (UNICHAR_ID unichar_id, char fragment_length, float rating, float certainty, int index) |
| |
| bool | contains_unichar_id (UNICHAR_ID unichar_id) const |
| |
| void | remove_unichar_ids (int index, int num) |
| |
| void | remove_last_unichar_id () |
| |
| void | remove_unichar_id (int index) |
| |
| bool | has_rtl_unichar_id () const |
| |
| void | reverse_and_mirror_unichar_ids () |
| |
| void | punct_stripped (int *start_core, int *end_core) const |
| |
| WERD_CHOICE | shallow_copy (int start, int end) const |
| |
| void | string_and_lengths (STRING *word_str, STRING *word_lengths_str) const |
| |
| const STRING | debug_string () const |
| |
| bool | set_unichars_in_script_order (bool in_script_order) |
| |
| bool | unichars_in_script_order () const |
| |
| const STRING & | unichar_string () const |
| |
| const STRING & | unichar_lengths () const |
| |
| const void | print () const |
| |
| const void | print (const char *msg) const |
| |
| WERD_CHOICE & | operator+= (const WERD_CHOICE &second) |
| |
| WERD_CHOICE & | operator= (const WERD_CHOICE &source) |
| |
Definition at line 186 of file ratngs.h.
| void WERD_CHOICE::init |
( |
const char * |
src_string, |
|
|
const char * |
src_lengths, |
|
|
float |
src_rating, |
|
|
float |
src_certainty, |
|
|
uinT8 |
src_permuter |
|
) |
| |
Helper function to build a WERD_CHOICE from the given string, fragment lengths, rating, certainty and permuter. The function assumes that src_string is not NULL. src_lengths argument could be NULL, in which case the unichars in src_string are assumed to all be of length 1.
WERD_CHOICE::init
Helper function to build a WERD_CHOICE from the given string, fragment lengths, rating, certainty and permuter.
The function assumes that src_string is not NULL. src_lengths argument could be NULL, in which case the unichars in src_string are assumed to all be of length 1.
Definition at line 140 of file ratngs.cpp.
145 int src_string_len = strlen(src_string);
146 if (src_string_len == 0) {
149 this->
init(src_lengths ? strlen(src_lengths): src_string_len);
152 for (
int i = 0; i < length_; ++i) {
153 int unichar_length = src_lengths ? src_lengths[i] : 1;
155 unicharset_->
unichar_to_id(src_string+offset, unichar_length);
156 fragment_lengths_[i] = 1;
157 offset += unichar_length;
160 rating_ = src_rating;
161 certainty_ = src_certainty;
162 permuter_ = src_permuter;
const UNICHAR_ID unichar_to_id(const char *const unichar_repr) const