summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-26 14:56:09 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-26 14:56:09 +0800
commit11dfb3b72c7128e05e8608ff501d06b80a2788c1 (patch)
treee393dbcb524fa3d4a8fd437e2631b5c525897242
parent6d821d1b145c307a9bd71c2615b8e596774d1c82 (diff)
downloadlibpinyin-11dfb3b72c7128e05e8608ff501d06b80a2788c1.zip
libpinyin-11dfb3b72c7128e05e8608ff501d06b80a2788c1.tar.gz
libpinyin-11dfb3b72c7128e05e8608ff501d06b80a2788c1.tar.xz
fixes pinyin_translate_token
-rw-r--r--src/pinyin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index f4a20fe..a3fd37d 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -590,11 +590,11 @@ bool pinyin_translate_token(pinyin_instance_t * instance,
PhraseItem item;
utf16_t buffer[MAX_PHRASE_LENGTH];
- bool retval = context->m_phrase_index->get_phrase_item(token, item);
+ int retval = context->m_phrase_index->get_phrase_item(token, item);
item.get_phrase_string(buffer);
guint8 length = item.get_phrase_length();
*word = g_utf16_to_utf8(buffer, length, NULL, NULL, NULL);
- return retval;
+ return retval == ERROR_OK;
}
bool pinyin_train(pinyin_instance_t * instance){