summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-02-17 10:43:59 +0800
committerPeng Wu <alexepico@gmail.com>2012-02-17 10:43:59 +0800
commita9fb045cae4df38786b12b4c66f316be5a0ee128 (patch)
tree9bbf93cd6acf163037d2712624c395b29732850c /src
parentad094960b7844a026e65c4d2aafb674783694a08 (diff)
downloadlibpinyin-a9fb045cae4df38786b12b4c66f316be5a0ee128.tar.gz
libpinyin-a9fb045cae4df38786b12b4c66f316be5a0ee128.tar.xz
libpinyin-a9fb045cae4df38786b12b4c66f316be5a0ee128.zip
fixes middle_and_final_level_search
Diffstat (limited to 'src')
-rw-r--r--src/storage/chewing_large_table.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp
index 93eacfe..cfcb987 100644
--- a/src/storage/chewing_large_table.cpp
+++ b/src/storage/chewing_large_table.cpp
@@ -212,9 +212,15 @@ int ChewingBitmapIndexLevel::middle_and_final_level_search
if (middle == CHEWING_ZERO_MIDDLE) { /* in-complete pinyin */
if (!(m_options & PINYIN_INCOMPLETE))
return result;
- for (int m = CHEWING_I; m < CHEWING_NUMBER_OF_MIDDLES; ++m)
- for (int n = CHEWING_A; n < CHEWING_NUMBER_OF_FINALS;
- ++n) {
+ for (int m = CHEWING_ZERO_MIDDLE;
+ m < CHEWING_NUMBER_OF_MIDDLES; ++m)
+ for (int n = CHEWING_ZERO_FINAL;
+ n < CHEWING_NUMBER_OF_FINALS; ++n) {
+
+ if (CHEWING_ZERO_MIDDLE == m &&
+ CHEWING_ZERO_FINAL == n)
+ continue;
+
result |= tone_level_search
(initial, (ChewingMiddle) m, (ChewingFinal) n,
phrase_length, keys, ranges);