Skip to content
epico edited this page Dec 4, 2012 · 5 revisions

libpinyin 0.9.x New API Proposal

Objective

  • almost pure C API;

  • expose methods in class PhraseItem;

    • API should use phrase token instead of use PhraseItem directly;

  • improves current pinyin lookup methods;

new API for chewing/pinyin key

To hide the C++ methods from class ChewingKey.

  • pinyin_get_chewing_string(instance, key, str);

  • pinyin_get_pinyin_string(instance, key, str);

expose methods in class PhraseItem;

To access the information in the class PhraseItem.

  • pinyin_token_get_phrase(instance, token, len, utf8_str);

  • pinyin_token_get_n_pronunciation(instance, token, num);

  • pinyin_token_get_nth_pronunciation(instance, token, nth, keys);

  • pinyin_token_get_unigram_frequency(instance, token, freq);

  • pinyin_token_add_unigram_frequency(instance, token, delta);

dropped methods

  • ChewingKey::get_chewing_string;

  • ChewingKey::get_pinyin_string;

  • pinyin_clear_constraint;

  • pinyin_clear_constraints;

  • pinyin_translate_token → pinyin_token_get_phrase;

  • pinyin_get_pinyins_from_token;