diff options
author | Peng Wu <alexepico@gmail.com> | 2012-10-19 15:04:30 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-10-19 15:05:14 +0800 |
commit | 1a663eac6e9dcd16375690d9ab54f51bf02c83b7 (patch) | |
tree | dd903459badc5009f97f9270dadf079953b079c5 | |
parent | 595692374597ac71f0f39ea2444ea9d80c2a6184 (diff) | |
download | libpinyin-1a663eac6e9dcd16375690d9ab54f51bf02c83b7.tar.gz libpinyin-1a663eac6e9dcd16375690d9ab54f51bf02c83b7.tar.xz libpinyin-1a663eac6e9dcd16375690d9ab54f51bf02c83b7.zip |
rename pinyin_lookup_token to pinyin_lookup_tokens
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/libpinyin.ver | 2 | ||||
-rw-r--r-- | src/pinyin.cpp | 6 | ||||
-rw-r--r-- | src/pinyin.h | 10 |
4 files changed, 10 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 71533df..8a2b5c2 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ m4_define([libpinyin_major_version], [0]) m4_define([libpinyin_minor_version], [8]) m4_define([libpinyin_micro_version], [91]) -m4_define([libpinyin_abi_current], [2]) +m4_define([libpinyin_abi_current], [3]) m4_define([libpinyin_abi_revision], [0]) m4_define([libpinyin_version], diff --git a/src/libpinyin.ver b/src/libpinyin.ver index c57c48a..78b27ba 100644 --- a/src/libpinyin.ver +++ b/src/libpinyin.ver @@ -30,7 +30,7 @@ LIBPINYIN { pinyin_free_candidates; pinyin_clear_constraint; pinyin_clear_constraints; - pinyin_lookup_token; + pinyin_lookup_tokens; pinyin_translate_token; pinyin_get_pinyins_from_token; pinyin_train; diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 765c4a1..b291c57 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1623,8 +1623,8 @@ bool pinyin_clear_constraints(pinyin_instance_t * instance){ return retval; } -bool pinyin_lookup_token(pinyin_instance_t * instance, - const char * phrase, phrase_token_t * token){ +bool pinyin_lookup_tokens(pinyin_instance_t * instance, + const char * phrase, GArray * tokenarray){ pinyin_context_t * & context = instance->m_context; FacadePhraseIndex * & phrase_index = context->m_phrase_index; @@ -1635,7 +1635,7 @@ bool pinyin_lookup_token(pinyin_instance_t * instance, memset(tokens, 0, sizeof(PhraseTokens)); phrase_index->prepare_tokens(tokens); int retval = context->m_phrase_table->search(ucs4_len, ucs4_phrase, tokens); - int num = get_first_token(tokens, *token); + int num = reduce_tokens(tokens, tokenarray); phrase_index->destroy_tokens(tokens); return SEARCH_OK & retval; diff --git a/src/pinyin.h b/src/pinyin.h index ac8468a..0634b2b 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -438,17 +438,17 @@ bool pinyin_clear_constraint(pinyin_instance_t * instance, bool pinyin_clear_constraints(pinyin_instance_t * instance); /** - * pinyin_lookup_token: + * pinyin_lookup_tokens: * @instance: the pinyin instance. * @phrase: the phrase to be looked up. - * @token: the returned phrase token. + * @tokenarray: the returned GArray of tokens. * @returns: whether the lookup operation is successful. * - * Lookup the token for the phrase utf8 string. + * Lookup the tokens for the phrase utf8 string. * */ -bool pinyin_lookup_token(pinyin_instance_t * instance, - const char * phrase, phrase_token_t * token); +bool pinyin_lookup_tokens(pinyin_instance_t * instance, + const char * phrase, GArray * tokenarray); /** * pinyin_translate_token: |