summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-08-13 10:42:32 +0800
committerPeng Wu <alexepico@gmail.com>2015-08-13 10:42:32 +0800
commit96731e989225b3963ba9747c2124cd4cce906456 (patch)
tree220da8d7cb070f7bccc4707c7509afe6784b5a31
parentd82b8cf16a23487c45dca0d54915206f973c248d (diff)
downloadlibzhuyin-96731e989225b3963ba9747c2124cd4cce906456.zip
libzhuyin-96731e989225b3963ba9747c2124cd4cce906456.tar.gz
libzhuyin-96731e989225b3963ba9747c2124cd4cce906456.tar.xz
fixes ChewingDiscreteParser21.0.91
-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;