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];
56 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
77 memcpy(word_alt_[
alt_cnt_], word_str, len *
sizeof(*word_str));
93 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
94 for (
int alt = alt_idx + 1; alt <
alt_cnt_; alt++) {
96 char_32 *pchTemp = word_alt_[alt_idx];
97 word_alt_[alt_idx] = word_alt_[alt];
98 word_alt_[alt] = pchTemp;
113 for (
int alt_idx = 0; alt_idx <
alt_cnt_; alt_idx++) {
114 char_32 *word_32 = word_alt_[alt_idx];
118 fprintf(stderr,
"Alt[%d]=%s (cost=%d, num_unichars=%d); unichars=", alt_idx,
119 word_str.c_str(),
alt_cost_[alt_idx], num_unichars);
120 for (
int i = 0; i < num_unichars; ++i)
121 fprintf(stderr,
"%d ", word_32[i]);
122 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)