diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libpinyin.ver | 3 | ||||
-rw-r--r-- | src/pinyin.cpp | 23 | ||||
-rw-r--r-- | src/pinyin.h | 8 |
3 files changed, 33 insertions, 1 deletions
diff --git a/src/libpinyin.ver b/src/libpinyin.ver index 54e389b..3ed126e 100644 --- a/src/libpinyin.ver +++ b/src/libpinyin.ver @@ -36,7 +36,8 @@ LIBPINYIN { pinyin_get_pinyins_from_token; pinyin_train; pinyin_reset; - _ZN6pinyin10ChewingKey*; + pinyin_get_chewing_string; + pinyin_get_pinyin_string; local: *; 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. */ diff --git a/src/pinyin.h b/src/pinyin.h index 645e02e..fd4e43a 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -514,6 +514,14 @@ bool pinyin_train(pinyin_instance_t * instance); bool pinyin_reset(pinyin_instance_t * instance); +bool pinyin_get_chewing_string(pinyin_instance_t * instance, + ChewingKey * key, + gchar ** utf8_str); + +bool pinyin_get_pinyin_string(pinyin_instance_t * instance, + ChewingKey * key, + gchar ** utf8_str); + /* hack here. */ typedef ChewingKey PinyinKey; typedef ChewingKeyRest PinyinKeyPos; |