From 3255745103f182bd326d1342e0e28fe7b032973f Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 7 Jun 2016 18:11:26 +0800 Subject: update pinyin.h --- src/pinyin.cpp | 6 ++---- src/pinyin.h | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 5b92048..2a10dd8 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1404,8 +1404,8 @@ static void _append_items(PhraseIndexRanges ranges, lookup_candidate_t item; item.m_candidate_type = template_item->m_candidate_type; item.m_token = k; - item.m_orig_rest = template_item->m_orig_rest; - item.m_new_pinyins = g_strdup(template_item->m_new_pinyins); + item.m_begin = template_item->m_begin; + item.m_end = template_item->m_end; item.m_freq = template_item->m_freq; g_array_append_val(items, item); } @@ -1527,8 +1527,6 @@ static bool _compute_phrase_strings_of_items(pinyin_instance_t * instance, break; } case NORMAL_CANDIDATE: - case DIVIDED_CANDIDATE: - case RESPLIT_CANDIDATE: case PREDICTED_CANDIDATE: _token_get_phrase (instance->m_context->m_phrase_index, diff --git a/src/pinyin.h b/src/pinyin.h index cbdfeb4..b486197 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -468,7 +468,7 @@ bool pinyin_in_chewing_keyboard(pinyin_instance_t * instance, /** * pinyin_guess_candidates: * @instance: the pinyin instance. - * @offset: the offset in the pinyin keys. + * @offset: the lookup offset. * @returns: whether a list of tokens are gotten. * * Guess the candidates at the offset. @@ -477,6 +477,7 @@ bool pinyin_in_chewing_keyboard(pinyin_instance_t * instance, bool pinyin_guess_candidates(pinyin_instance_t * instance, size_t offset); +#if 0 /** * pinyin_guess_full_pinyin_candidates: * @instance: the pinyin instance. @@ -488,6 +489,7 @@ bool pinyin_guess_candidates(pinyin_instance_t * instance, */ bool pinyin_guess_full_pinyin_candidates(pinyin_instance_t * instance, size_t offset); +#endif /** * pinyin_choose_candidate: @@ -855,19 +857,20 @@ bool pinyin_get_pinyin_key_rest_length(pinyin_instance_t * instance, guint16 * length); /** - * pinyin_get_pinyin_key_rest_offset: + * pinyin_get_pinyin_offset: * @instance: the pinyin instance. - * @cursor: the cursor. - * @offset: the offset in the pinyin array. + * @cursor: the user cursor. + * @offset: the lookup offset. * @returns: whether the get operation is successful. * - * Get the offset in the pinyin key array. + * Get the lookup offset from the user cursor. * */ -bool pinyin_get_pinyin_key_rest_offset(pinyin_instance_t * instance, - guint16 cursor, - guint16 * offset); +bool pinyin_get_pinyin_offset(pinyin_instance_t * instance, + guint16 cursor, + guint16 * offset); +#if 0 /** * pinyin_get_raw_full_pinyin: * @instance: the pinyin instance. @@ -879,6 +882,7 @@ bool pinyin_get_pinyin_key_rest_offset(pinyin_instance_t * instance, */ bool pinyin_get_raw_full_pinyin(pinyin_instance_t * instance, const gchar ** utf8_str); +#endif /** * pinyin_get_n_phrase: -- cgit