From 3d1f1928a5d3317e90767a094466f3b2a0604254 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 4 Dec 2012 10:04:09 +0800 Subject: write pinyin_get_chewing/pinyin_string --- src/pinyin.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/pinyin.cpp') diff --git a/src/pinyin.cpp b/src/pinyin.cpp index a7d83be..bba9f1a 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1795,6 +1795,29 @@ bool pinyin_reset(pinyin_instance_t * instance){ return true; } +bool pinyin_get_chewing_string(pinyin_instance_t * instance, + ChewingKey * key, + gchar ** utf8_str) { + *utf8_str = NULL; + if (0 == key->get_table_index()) + return false; + + *utf8_str = key->get_chewing_string(); + return true; +} + +bool pinyin_get_pinyin_string(pinyin_instance_t * instance, + ChewingKey * key, + gchar ** utf8_str) { + *utf8_str = NULL; + if (0 == key->get_table_index()) + return false; + + *utf8_str = key->get_pinyin_string(); + return true; +} + + /** * Note: prefix is the text before the pre-edit string. */ -- cgit