remove pinyin_get_pinyins_from_token
authorPeng Wu <alexepico@gmail.com>
Wed, 5 Dec 2012 03:07:53 +0000 (11:07 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 5 Dec 2012 03:07:53 +0000 (11:07 +0800)
src/libpinyin.ver
src/pinyin.cpp
src/pinyin.h

index 847fa97..a156215 100644 (file)
@@ -30,7 +30,6 @@ LIBPINYIN {
         pinyin_choose_candidate;
         pinyin_free_candidates;
         pinyin_lookup_tokens;
-        pinyin_get_pinyins_from_token;
         pinyin_train;
         pinyin_reset;
         pinyin_get_chewing_string;
index 9f886ea..dff7381 100644 (file)
@@ -1709,27 +1709,6 @@ bool pinyin_lookup_tokens(pinyin_instance_t * instance,
     return SEARCH_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;
-    FacadePhraseIndex * & phrase_index = context->m_phrase_index;
-    PhraseItem item;
-
-    int retval = phrase_index->get_phrase_item(token, item);
-    if (1 != item.get_phrase_length())
-        return false;
-
-    guint8 npinyin = item.get_n_pronunciation();
-    size_t i;
-    ChewingKey onekey; guint32 freq;
-    for (i = 0; i < npinyin; ++i){
-        item.get_nth_pronunciation(i, &onekey, freq);
-        g_array_append_val(pinyinkeys, onekey);
-    }
-    return true;
-}
-
-
 bool pinyin_train(pinyin_instance_t * instance){
     if (!instance->m_context->m_user_dir)
         return false;
index 25cf932..9c2618e 100644 (file)
@@ -444,19 +444,6 @@ bool pinyin_lookup_tokens(pinyin_instance_t * instance,
                           const char * phrase, GArray * tokenarray);
 
 /**
- * pinyin_get_pinyins_from_token:
- * @instance: the pinyin instance.
- * @token: the character token.
- * @pinyinkeys: the pinyin keys from the character token.
- * @returns: whether the pinyin keys is retrieved.
- *
- * Get the pinyin keys for the character token.
- *
- */
-bool pinyin_get_pinyins_from_token(pinyin_instance_t * instance,
-                                   phrase_token_t token, GArray * pinyinkeys);
-
-/**
  * pinyin_train:
  * @instance: the pinyin instance.
  * @returns: whether the sentence is trained.