case NORMAL_CANDIDATE:
case DIVIDED_CANDIDATE:
case RESPLIT_CANDIDATE:
- pinyin_translate_token
- (instance, candidate->m_token, &(candidate->m_phrase_string));
+ pinyin_token_get_phrase
+ (instance, candidate->m_token, NULL,
+ &(candidate->m_phrase_string));
break;
case ZOMBIE_CANDIDATE:
break;
phrase_token_t token,
guint * len,
gchar ** utf8_str) {
- *len = 0; *utf8_str = NULL;
pinyin_context_t * & context = instance->m_context;
PhraseItem item;
ucs4_t buffer[MAX_PHRASE_LENGTH];
return false;
item.get_phrase_string(buffer);
- *len = item.get_phrase_length();
- *utf8_str = g_ucs4_to_utf8(buffer, *len, NULL, NULL, NULL);
+ guint length = item.get_phrase_length();
+ if (len)
+ *len = length;
+ if (utf8_str)
+ *utf8_str = g_ucs4_to_utf8(buffer, length, NULL, NULL, NULL);
return true;
}
continue;
char * word = NULL;
- pinyin_translate_token(instance, token, &word);
+ pinyin_token_get_phrase(instance, token, NULL, &word);
printf("%s\t", word);
g_free(word);
}