diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pinyin.cpp | 4 | ||||
-rw-r--r-- | src/pinyin.h | 36 |
2 files changed, 36 insertions, 4 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 48f8c59..5ac5a07 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1,9 +1,6 @@ #include "pinyin.h" -/* Place holder for combining static libraries in sub-directories. */ - /* Note: will implement a glue layer for input method integration. - * Refer to: fcitx-sunpinyin */ struct _pinyin_context_t{ @@ -145,7 +142,6 @@ bool pinyin_set_pinyin_keys(pinyin_context_t * context, return true; } - /* the returned sentence should be freed by g_free(). */ bool pinyin_get_guessed_sentence(pinyin_context_t * context, char ** sentence){ diff --git a/src/pinyin.h b/src/pinyin.h index bd3c4ff..90c9221 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -19,3 +19,39 @@ using namespace pinyin; typedef struct _pinyin_context_t pinyin_context_t; + +pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir); +void pinyin_fini(pinyin_context_t * context); + +bool pinyin_set_options(pinyin_context_t * context, + PinyinCustomSettings * custom); +bool pinyin_set_pinyin_keys(pinyin_context_t * context, + PinyinKeyVector pinyin_keys); + +bool pinyin_get_guessed_sentence(pinyin_context_t * context, + char ** sentence); +bool pinyin_parse_full(pinyin_context_t * context, + const char * onepinyin, + PinyinKey * onekey); +bool pinyin_parse_more_fulls(pinyin_context_t * context, + const char * pinyins, + PinyinKeyVector pinyin_keys); +bool pinyin_parse_double(pinyin_context_t * context, + const char * onepinyin, + PinyinKey * onekey); +bool pinyin_parse_more_doubles(pinyin_context_t * context, + const char * onepinyin, + PinyinKeyVector pinyin_keys); + +bool pinyin_get_candidates(pinyin_context_t * context, + size_t offset, TokenVector candidates); +bool pinyin_choose_candidate(pinyin_context_t * context, + size_t offset, phrase_token_t token); + +bool pinyin_clear_constraints(pinyin_context_t * context); +bool pinyin_translate_token(pinyin_context_t * context, + phrase_token_t token, char ** word); + +bool pinyin_train(pinyin_context_t * context); +bool pinyin_save(pinyin_context_t * context); +bool pinyin_reset(pinyin_context_t * context); |