29 if (word_alt_ !=
NULL) {
30 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
31 if (word_alt_[alt_idx] !=
NULL) {
32 delete []word_alt_[alt_idx];
54 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
75 memcpy(word_alt_[
alt_cnt_], word_str, len *
sizeof(*word_str));
89 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
90 for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
92 char_32 *pchTemp = word_alt_[alt_idx];
93 word_alt_[alt_idx] = word_alt_[alt];
94 word_alt_[alt] = pchTemp;
109 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
110 char_32 *word_32 = word_alt_[alt_idx];
114 fprintf(stderr,
"Alt[%d]=%s (cost=%d, num_unichars=%d); unichars=", alt_idx,
115 word_str.c_str(),
alt_cost_[alt_idx], num_unichars);
116 for (
int i = 0; i < num_unichars; ++i)
117 fprintf(stderr,
"%d ", word_32[i]);
118 fprintf(stderr,
"\n");
bool Insert(char_32 *char_ptr, int cost, void *tag=NULL)
static int StrLen(const char_32 *str)
static void UTF32ToUTF8(const char_32 *utf32_str, string *str)
static int StrCmp(const char_32 *str1, const char_32 *str2)