summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-29 14:09:28 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-29 14:09:28 +0800
commita5871126f29fb0bdf4a994221f4e51301c77aed1 (patch)
tree96171df2ce79694fc08d7b5e78af42da55c9f107
parentc0a3bc04c7963f8a53447acec77497f28646fdf9 (diff)
downloadlibpinyin-a5871126f29fb0bdf4a994221f4e51301c77aed1.zip
libpinyin-a5871126f29fb0bdf4a994221f4e51301c77aed1.tar.gz
libpinyin-a5871126f29fb0bdf4a994221f4e51301c77aed1.tar.xz
improve pinyin parser
-rw-r--r--src/pinyin.cpp2
-rw-r--r--src/storage/pinyin_base.cpp4
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
}