From a5871126f29fb0bdf4a994221f4e51301c77aed1 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 29 Aug 2011 14:09:28 +0800 Subject: improve pinyin parser --- src/pinyin.cpp | 2 ++ src/storage/pinyin_base.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 4bc000a..fb43394 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -377,5 +377,7 @@ bool pinyin_reset(pinyin_context_t * context){ * Note: prefix is the text before the pre-edit string. * bool pinyin_get_guessed_sentence_with_prefix(...); * bool pinyin_get_candidates_with_prefix(...); + * bool phrase_segment(...); + * bool pinyin_clear_constraint(...); * For context-dependent order of the candidates list. */ diff --git a/src/storage/pinyin_base.cpp b/src/storage/pinyin_base.cpp index 7e2f805..f23c4cf 100644 --- a/src/storage/pinyin_base.cpp +++ b/src/storage/pinyin_base.cpp @@ -1068,7 +1068,7 @@ __default_parser_parse_recursive (const PinyinValidator &validator, // A better seq was found. if (remained_len != 0 && (remained_len + first_len) >= (best_remained_len + best_first_len) && (remained_keys <= best_remained_keys || best_remained_keys == 0)) { -#if 0 +#if 1 if ((remained_len + first_len) > (best_remained_len + best_first_len) || remained_keys < best_remained_keys || best_remained_element->key.get_final () == PINYIN_ZeroFinal || @@ -1080,7 +1080,7 @@ __default_parser_parse_recursive (const PinyinValidator &validator, best_remained_len = remained_len; best_remained_keys = remained_keys; best_remained_start = remained_start; -#if 0 +#if 1 } #endif } -- cgit