fixes pinyin_translate_token
authorPeng Wu <alexepico@gmail.com>
Mon, 26 Dec 2011 06:56:09 +0000 (14:56 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 26 Dec 2011 06:56:09 +0000 (14:56 +0800)
src/pinyin.cpp

index f4a20feacecaccf6e0b99aa599df5f6a25bcee01..a3fd37dea35a9fe2f9fa8efbc9ef492332c1c34f 100644 (file)
@@ -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){