From 619ed8a8d8e2ec2d4c64c6922c4a190033dfe6ee Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 28 May 2015 15:34:24 +0800 Subject: update pinyin_token_get_phrase function --- src/pinyin.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 35ab5ce..76c5521 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -2467,20 +2467,9 @@ bool pinyin_token_get_phrase(pinyin_instance_t * instance, guint * len, gchar ** utf8_str) { pinyin_context_t * & context = instance->m_context; - PhraseItem item; - ucs4_t buffer[MAX_PHRASE_LENGTH]; - int retval = context->m_phrase_index->get_phrase_item(token, item); - if (ERROR_OK != retval) - return false; - - item.get_phrase_string(buffer); - 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; + return _token_get_phrase(context->m_phrase_index, + token, len, utf8_str); } bool pinyin_token_get_n_pronunciation(pinyin_instance_t * instance, -- cgit