From a9fb045cae4df38786b12b4c66f316be5a0ee128 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 17 Feb 2012 10:43:59 +0800 Subject: fixes middle_and_final_level_search --- src/storage/chewing_large_table.cpp | 12 +++++++++--- 1 file 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); -- cgit