diff options
-rw-r--r-- | src/pinyin.cpp | 4 | ||||
-rw-r--r-- | utils/segment/spseg.cpp | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp index b107918..b2865ef 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1717,8 +1717,10 @@ bool pinyin_guess_candidates(pinyin_instance_t * instance, retval = search_matrix(context->m_addon_pinyin_table, &matrix, start, end, addon_ranges) | retval; - if ( !(retval & SEARCH_OK) ) + if ( !(retval & SEARCH_OK) ) { + ++end; continue; + } lookup_candidate_t template_item; template_item.m_begin = start; template_item.m_end = end; diff --git a/utils/segment/spseg.cpp b/utils/segment/spseg.cpp index b434e4a..5934270 100644 --- a/utils/segment/spseg.cpp +++ b/utils/segment/spseg.cpp @@ -106,6 +106,7 @@ bool segment(FacadePhraseTable3 * phrase_table, ucs4_t * cur_phrase = phrase + i; phrase_token_t token = null_token; + phrase_index->clear_tokens(tokens); int result = phrase_table->search(len, cur_phrase, tokens); int num = get_first_token(tokens, token); |