From 96731e989225b3963ba9747c2124cd4cce906456 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 13 Aug 2015 10:42:32 +0800 Subject: fixes ChewingDiscreteParser2 --- src/storage/pinyin_parser2.cpp | 10 +++++----- tests/storage/test_parser2.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index a3bb735..433631b 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -768,14 +768,14 @@ bool ChewingDiscreteParser2::parse_one_key(pinyin_option_t options, if (search_chewing_tones(m_tone_table, str[index], &tone)) { index ++; } - - /* check the force tone option. */ - if (options & FORCE_TONE && CHEWING_ZERO_TONE == tone) { - return false; - } } probe: + /* check the force tone option. */ + if (options & FORCE_TONE && CHEWING_ZERO_TONE == tone) { + return false; + } + gchar * chewing = g_strconcat(initial, middle, final, NULL); /* search the chewing in the chewing index table. */ diff --git a/tests/storage/test_parser2.cpp b/tests/storage/test_parser2.cpp index 2fa00a1..3205e01 100644 --- a/tests/storage/test_parser2.cpp +++ b/tests/storage/test_parser2.cpp @@ -64,7 +64,7 @@ int main(int argc, char * argv[]) { exit(EINVAL); } - pinyin_option_t options = USE_TONE; + pinyin_option_t options = USE_TONE|FORCE_TONE; if (incomplete) options |= PINYIN_INCOMPLETE | CHEWING_INCOMPLETE; -- cgit