summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/storage/pinyin_parser2.cpp10
-rw-r--r--tests/storage/test_parser2.cpp2
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;