summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libpinyin.ver1
-rw-r--r--src/pinyin.cpp14
-rw-r--r--src/pinyin.h15
3 files changed, 0 insertions, 30 deletions
diff --git a/src/libpinyin.ver b/src/libpinyin.ver
index cde942a..847fa97 100644
--- a/src/libpinyin.ver
+++ b/src/libpinyin.ver
@@ -30,7 +30,6 @@ LIBPINYIN {
pinyin_choose_candidate;
pinyin_free_candidates;
pinyin_lookup_tokens;
- pinyin_translate_token;
pinyin_get_pinyins_from_token;
pinyin_train;
pinyin_reset;
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 13377ad..9f886ea 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -1709,20 +1709,6 @@ bool pinyin_lookup_tokens(pinyin_instance_t * instance,
return SEARCH_OK & retval;
}
-/* the returned word should be freed by g_free. */
-bool pinyin_translate_token(pinyin_instance_t * instance,
- phrase_token_t token, char ** word){
- pinyin_context_t * & context = instance->m_context;
- PhraseItem item;
- ucs4_t buffer[MAX_PHRASE_LENGTH];
-
- int retval = context->m_phrase_index->get_phrase_item(token, item);
- item.get_phrase_string(buffer);
- guint8 length = item.get_phrase_length();
- *word = g_ucs4_to_utf8(buffer, length, NULL, NULL, NULL);
- return ERROR_OK == retval;
-}
-
bool pinyin_get_pinyins_from_token(pinyin_instance_t * instance,
phrase_token_t token, GArray * pinyinkeys){
pinyin_context_t * & context = instance->m_context;
diff --git a/src/pinyin.h b/src/pinyin.h
index 136848e..25cf932 100644
--- a/src/pinyin.h
+++ b/src/pinyin.h
@@ -444,21 +444,6 @@ bool pinyin_lookup_tokens(pinyin_instance_t * instance,
const char * phrase, GArray * tokenarray);
/**
- * pinyin_translate_token:
- * @instance: the pinyin instance.
- * @token: the phrase token.
- * @word: the phrase in utf-8.
- * @returns: whether the token is valid.
- *
- * Translate the token to utf-8 phrase.
- *
- * Note: the returned word should be freed by g_free().
- *
- */
-bool pinyin_translate_token(pinyin_instance_t * instance,
- phrase_token_t token, char ** word);
-
-/**
* pinyin_get_pinyins_from_token:
* @instance: the pinyin instance.
* @token: the character token.