static gint compare_item_with_token(gconstpointer lhs,
- gconstpointer rhs) {
+ gconstpointer rhs) {
lookup_candidate_t * item_lhs = (lookup_candidate_t *)lhs;
lookup_candidate_t * item_rhs = (lookup_candidate_t *)rhs;
}
static gint compare_item_with_frequency(gconstpointer lhs,
- gconstpointer rhs) {
+ gconstpointer rhs) {
lookup_candidate_t * item_lhs = (lookup_candidate_t *)lhs;
lookup_candidate_t * item_rhs = (lookup_candidate_t *)rhs;
}
for (i = pinyin_len; i >= 1; --i) {
+ bool found = false;
g_array_set_size(items, 0);
if (2 == i) {
/* handle fuzzy pinyin segment here. */
if (options & USE_DIVIDED_TABLE) {
- _try_divided_table(instance, ranges, offset, items);
+ found = _try_divided_table(instance, ranges, offset, items);
}
if (options & USE_RESPLIT_TABLE) {
assert(FALSE);
int retval = context->m_pinyin_table->search
(i, keys, ranges);
- if ( !(retval & SEARCH_OK) )
+ found = (retval & SEARCH_OK) || found;
+
+ if ( !found )
continue;
lookup_candidate_t template_item;
const divided_table_item_t * FullPinyinParser2::retrieve_divided_item
(pinyin_option_t options, ChewingKey * key, ChewingKeyRest * rest,
const char * str, int len) const {
- guint16 tone = CHEWING_ZERO_TONE;
/* lookup divided table */
size_t k;