summaryrefslogtreecommitdiffstats
path: root/scripts/genpytable.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-10-21 17:35:25 +0800
committerPeng Wu <alexepico@gmail.com>2011-10-21 17:35:25 +0800
commitdf20383358485ac69158b6dd4bec1a3c2e5bf9ea (patch)
tree26bb6fdbcdebdc41d7abc567d66cb6ddda44dffd /scripts/genpytable.py
parent7114c007f02e6005fd08b5647e48d53184a0739a (diff)
downloadlibpinyin-df20383358485ac69158b6dd4bec1a3c2e5bf9ea.tar.gz
libpinyin-df20383358485ac69158b6dd4bec1a3c2e5bf9ea.tar.xz
libpinyin-df20383358485ac69158b6dd4bec1a3c2e5bf9ea.zip
improves get chewing
Diffstat (limited to 'scripts/genpytable.py')
-rw-r--r--scripts/genpytable.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/genpytable.py b/scripts/genpytable.py
index ed2686f..dff65dd 100644
--- a/scripts/genpytable.py
+++ b/scripts/genpytable.py
@@ -59,11 +59,21 @@ def get_chewing(pinyin_key):
middle = chewing.CHEWING_ASCII_MIDDLE_MAP[char]
if char in chewing.CHEWING_ASCII_FINAL_MAP:
final = chewing.CHEWING_ASCII_FINAL_MAP[char]
- if char == "ㄜ":
+ if char == "ㄜ": #merge "ㄝ" and "ㄜ"
final = "CHEWING_E"
+ #handle "ueng"/"ong"
if middle == "CHEWING_U" and final == "CHEWING_ENG":
middle, final = "CHEWING_ZERO_MIDDLE", "PINYIN_ONG"
+
+ #handle "ien"/"in"
+ if middle == "CHEWING_I" and final == "CHEWING_EN":
+ middle, final = "CHEWING_ZERO_MIDDLE", "PINYIN_IN"
+
+ #handle "ieng"/"ing"
+ if middle == "CHEWING_I" and final == "CHEWING_ENG":
+ middle, final = "CHEWING_ZERO_MIDDLE", "PINYIN_ING"
+
return initial, middle, final