diff options
author | Peng Wu <alexepico@gmail.com> | 2011-09-09 15:53:59 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-09-09 15:53:59 +0800 |
commit | 3723941d4c85446ab6c63ed5eaa72efee57fae0a (patch) | |
tree | efd1ce4052a58d003b75bdf0dfaf0d10de1922c9 | |
parent | 014d8c208f4edd8be02929893e270b1fbe17082b (diff) | |
download | libpinyin-3723941d4c85446ab6c63ed5eaa72efee57fae0a.tar.gz libpinyin-3723941d4c85446ab6c63ed5eaa72efee57fae0a.tar.xz libpinyin-3723941d4c85446ab6c63ed5eaa72efee57fae0a.zip |
refine public api
-rw-r--r-- | src/libpinyin.ver | 12 | ||||
-rw-r--r-- | src/pinyin.cpp | 24 | ||||
-rw-r--r-- | src/pinyin.h | 20 |
3 files changed, 28 insertions, 28 deletions
diff --git a/src/libpinyin.ver b/src/libpinyin.ver index b733c7b..91ab813 100644 --- a/src/libpinyin.ver +++ b/src/libpinyin.ver @@ -4,15 +4,15 @@ LIBPINYIN { pinyin_save; pinyin_fini; pinyin_set_options; - pinyin_get_instance; - pinyin_release_instance; + pinyin_alloc_instance; + pinyin_free_instance; pinyin_guess_sentence; pinyin_phrase_segment; pinyin_get_sentence; - pinyin_parse_full; - pinyin_parse_more_fulls; - pinyin_parse_double; - pinyin_parse_more_doubles; + pinyin_parse_full_pinyin; + pinyin_parse_more_full_pinyins; + pinyin_parse_double_pinyin; + pinyin_parse_more_double_pinyins; pinyin_parse_chewing; pinyin_parse_more_chewings; pinyin_get_candidates; diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 706250d..6757820 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -141,7 +141,7 @@ bool pinyin_set_options(pinyin_context_t * context, } -pinyin_instance_t * pinyin_get_instance(pinyin_context_t * context){ +pinyin_instance_t * pinyin_alloc_instance(pinyin_context_t * context){ pinyin_instance_t * instance = new pinyin_instance_t; instance->m_context = context; @@ -155,7 +155,7 @@ pinyin_instance_t * pinyin_get_instance(pinyin_context_t * context){ return instance; } -void pinyin_release_instance(pinyin_instance_t * instance){ +void pinyin_free_instance(pinyin_instance_t * instance){ g_array_free(instance->m_pinyin_keys, TRUE); g_array_free(instance->m_pinyin_poses, TRUE); g_array_free(instance->m_constraints, TRUE); @@ -226,9 +226,9 @@ bool pinyin_get_sentence(pinyin_instance_t * instance, return retval; } -bool pinyin_parse_full(pinyin_instance_t * instance, - const char * onepinyin, - PinyinKey * onekey){ +bool pinyin_parse_full_pinyin(pinyin_instance_t * instance, + const char * onepinyin, + PinyinKey * onekey){ pinyin_context_t * & context = instance->m_context; int pinyin_len = strlen(onepinyin); @@ -237,8 +237,8 @@ bool pinyin_parse_full(pinyin_instance_t * instance, return pinyin_len == parse_len; } -bool pinyin_parse_more_fulls(pinyin_instance_t * instance, - const char * pinyins){ +bool pinyin_parse_more_full_pinyins(pinyin_instance_t * instance, + const char * pinyins){ pinyin_context_t * & context = instance->m_context; int pinyin_len = strlen(pinyins); @@ -249,9 +249,9 @@ bool pinyin_parse_more_fulls(pinyin_instance_t * instance, return pinyin_len == parse_len; } -bool pinyin_parse_double(pinyin_instance_t * instance, - const char * onepinyin, - PinyinKey * onekey){ +bool pinyin_parse_double_pinyin(pinyin_instance_t * instance, + const char * onepinyin, + PinyinKey * onekey){ pinyin_context_t * & context = instance->m_context; int pinyin_len = strlen(onepinyin); @@ -260,8 +260,8 @@ bool pinyin_parse_double(pinyin_instance_t * instance, return pinyin_len == parse_len; } -bool pinyin_parse_more_doubles(pinyin_instance_t * instance, - const char * pinyins){ +bool pinyin_parse_more_double_pinyins(pinyin_instance_t * instance, + const char * pinyins){ pinyin_context_t * & context = instance->m_context; int pinyin_len = strlen(pinyins); diff --git a/src/pinyin.h b/src/pinyin.h index 9f88cd6..1d65416 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -49,8 +49,8 @@ void pinyin_fini(pinyin_context_t * context); bool pinyin_set_options(pinyin_context_t * context, PinyinCustomSettings * custom); -pinyin_instance_t * pinyin_get_instance(pinyin_context_t * context); -void pinyin_release_instance(pinyin_instance_t * instance); +pinyin_instance_t * pinyin_alloc_instance(pinyin_context_t * context); +void pinyin_free_instance(pinyin_instance_t * instance); bool pinyin_guess_sentence(pinyin_instance_t * instance); @@ -60,16 +60,16 @@ bool pinyin_phrase_segment(pinyin_instance_t * instance, bool pinyin_get_sentence(pinyin_instance_t * instance, char ** sentence); -bool pinyin_parse_full(pinyin_instance_t * instance, - const char * onepinyin, - PinyinKey * onekey); -bool pinyin_parse_more_fulls(pinyin_instance_t * instance, +bool pinyin_parse_full_pinyin(pinyin_instance_t * instance, + const char * onepinyin, + PinyinKey * onekey); +bool pinyin_parse_more_full_pinyins(pinyin_instance_t * instance, const char * pinyins); -bool pinyin_parse_double(pinyin_instance_t * instance, - const char * onepinyin, - PinyinKey * onekey); -bool pinyin_parse_more_doubles(pinyin_instance_t * instance, +bool pinyin_parse_double_pinyin(pinyin_instance_t * instance, + const char * onepinyin, + PinyinKey * onekey); +bool pinyin_parse_more_double_pinyins(pinyin_instance_t * instance, const char * pinyins); bool pinyin_parse_chewing(pinyin_instance_t * instance, |