36 unichar_id_ = INVALID_UNICHAR_ID;
42 language_model_state_ =
NULL;
50 inT16 src_fontinfo_id,
51 inT16 src_fontinfo_id2,
78 return language_model_state_;
97 unichar_id_ = newunichar_id;
106 fontinfo_id_ = newfont;
109 fontinfo_id2_ = newfont;
112 script_id_ = newscript_id;
132 tprintf(
"r%.2f c%.2f : %d %s", rating_, certainty_, unichar_id_,
133 (unicharset ==
NULL) ?
"" :
157 void *language_model_state_;
191 : unicharset_(unicharset) { this->
init(8); }
193 : unicharset_(unicharset) { this->
init(reserved); }
195 const char *src_lengths,
200 : unicharset_(&unicharset) {
201 this->
init(src_string, src_lengths, src_rating,
202 src_certainty, src_permuter);
221 assert(index < length_);
222 return unichar_ids_[index];
225 return fragment_lengths_;
228 assert(index < length_);
229 return fragment_lengths_[index];
242 return fragment_mark_;
245 return blob_choices_;
248 assert(index < length_);
252 assert(index < length_);
253 fragment_lengths_[index] = flen;
259 certainty_ = new_val;
265 fragment_mark_ = new_fragment_mark;
280 reserved_, unichar_ids_);
282 reserved_, fragment_lengths_);
286 fragment_lengths_ =
new char[1];
293 inline void init(
int reserved) {
294 reserved_ = reserved;
297 fragment_lengths_ =
new char[reserved];
300 fragment_lengths_ =
NULL;
306 fragment_mark_ =
false;
307 blob_choices_ =
NULL;
308 unichars_in_script_order_ =
false;
316 void init(
const char *src_string,
const char *src_lengths,
317 float src_rating,
float src_certainty,
325 fragment_mark_ =
false;
334 assert(reserved_ > length_);
337 rating, certainty, length_-1);
345 assert(index < length_);
349 if (certainty < certainty_) {
375 for (
int i = 0; i < length_; ++i) {
376 word_str += unicharset_->
debug_str(unichar_ids_[i]);
386 return unichars_in_script_order_ = in_script_order;
390 return unichars_in_script_order_;
397 return unichar_string_;
404 return unichar_lengths_;
407 const void print(
const char *msg)
const;
417 char *fragment_lengths_;
428 BLOB_CHOICE_LIST_CLIST *blob_choices_;
434 bool unichars_in_script_order_;
438 mutable STRING unichar_string_;
439 mutable STRING unichar_lengths_;
441 bool unichar_info_present;
444 void delete_blob_choices();
461 BLOB_CHOICE_LIST *ratings,
467 BLOB_CHOICE_LIST *ratings,
473 const BLOB_CHOICE_LIST_VECTOR &char_choices,