summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-08-08 14:01:11 +0800
committerPeng Wu <alexepico@gmail.com>2013-08-08 14:01:11 +0800
commitc02152165010b210341f6fd1fc8a2fbcb55ff781 (patch)
tree5407b25060be032e2c5322744be5d43219dd8ef4 /src/storage/pinyin_parser2.cpp
parent201f23546126ae23f6e14b38328d0a4479be415a (diff)
downloadlibzhuyin-c02152165010b210341f6fd1fc8a2fbcb55ff781.tar.gz
libzhuyin-c02152165010b210341f6fd1fc8a2fbcb55ff781.tar.xz
libzhuyin-c02152165010b210341f6fd1fc8a2fbcb55ff781.zip
simplify full pinyin parser v2
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r--src/storage/pinyin_parser2.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index ff96815..c26e036 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -341,45 +341,6 @@ int FullPinyinParser2::parse (pinyin_option_t options, ChewingKeyVector & keys,
value.m_num_keys < nextstep->m_num_keys)
*nextstep = value;
- /* handle with the same pinyin length and the number of keys */
- if (value.m_parsed_len == nextstep->m_parsed_len &&
- value.m_num_keys == nextstep->m_num_keys) {
-
-#if 0
- /* prefer the complete pinyin with shengmu
- * over without shengmu,
- * ex: "kaneiji" -> "ka'nei'ji".
- */
- if ((value.m_key.m_initial != CHEWING_ZERO_INITIAL &&
- !(value.m_key.m_middle == CHEWING_ZERO_MIDDLE &&
- value.m_key.m_final == CHEWING_ZERO_FINAL)) &&
- nextstep->m_key.m_initial == CHEWING_ZERO_INITIAL)
- *nextstep = value;
-
- /* prefer the complete pinyin 'er'
- * over the in-complete pinyin 'r',
- * ex: "xierqi" -> "xi'er'qi."
- */
- if ((value.m_key.m_initial == CHEWING_ZERO_INITIAL &&
- value.m_key.m_middle == CHEWING_ZERO_MIDDLE &&
- value.m_key.m_final == CHEWING_ER) &&
- (nextstep->m_key.m_initial == CHEWING_R &&
- nextstep->m_key.m_middle == CHEWING_ZERO_MIDDLE &&
- nextstep->m_key.m_final == CHEWING_ZERO_FINAL))
- *nextstep = value;
-#endif
-
- /* prefer the 'a' at the end of clause,
- * ex: "zheyanga$" -> "zhe'yang'a$".
- */
- if (value.m_parsed_len == len &&
- (nextstep->m_key.m_initial != CHEWING_ZERO_INITIAL &&
- nextstep->m_key.m_final == CHEWING_A) &&
- (value.m_key.m_initial == CHEWING_ZERO_INITIAL &&
- value.m_key.m_middle == CHEWING_ZERO_MIDDLE &&
- value.m_key.m_final == CHEWING_A))
- *nextstep = value;
- }
}
}
}