diff options
author | Peng Wu <alexepico@gmail.com> | 2017-08-17 16:32:51 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2017-08-17 16:44:28 +0800 |
commit | bc600e1d24e543c82bb6acf35d2195d50dbf5495 (patch) | |
tree | 59b0117511a04827121003059f54a4ae32f8003b /src/pinyin.h | |
parent | de67e9c1a634759b0101c53a6d77fe0b579ce9a6 (diff) | |
download | libpinyin-bc600e1d24e543c82bb6acf35d2195d50dbf5495.tar.gz libpinyin-bc600e1d24e543c82bb6acf35d2195d50dbf5495.tar.xz libpinyin-bc600e1d24e543c82bb6acf35d2195d50dbf5495.zip |
add sort option to pinyin_guess_candidates function
Diffstat (limited to 'src/pinyin.h')
-rw-r--r-- | src/pinyin.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/pinyin.h b/src/pinyin.h index 7ebb82f..6328e1d 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -47,6 +47,11 @@ typedef enum _lookup_candidate_type_t{ ADDON_CANDIDATE, } lookup_candidate_type_t; +typedef enum _sort_option_t{ + SORT_BY_PHRASE_LENGTH_AND_FREQUENCY = 1, + SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY, +} sort_option_t; + /** * pinyin_init: * @systemdir: the system wide language model data directory. @@ -470,27 +475,15 @@ bool pinyin_in_chewing_keyboard(pinyin_instance_t * instance, * pinyin_guess_candidates: * @instance: the pinyin instance. * @offset: the lookup offset. + * @sort_option: the sort option. * @returns: whether a list of tokens are gotten. * * Guess the candidates at the offset. * */ bool pinyin_guess_candidates(pinyin_instance_t * instance, - size_t offset); - -#if 0 -/** - * pinyin_guess_full_pinyin_candidates: - * @instance: the pinyin instance. - * @offset: the offset in the pinyin keys. - * @returns: whether a list of lookup_candidate_t candidates are gotten. - * - * Guess the full pinyin candidates at the offset. - * - */ -bool pinyin_guess_full_pinyin_candidates(pinyin_instance_t * instance, - size_t offset); -#endif + size_t offset, + sort_option_t sort_option); /** * pinyin_choose_candidate: |