From df20383358485ac69158b6dd4bec1a3c2e5bf9ea Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 21 Oct 2011 17:35:25 +0800 Subject: improves get chewing --- scripts/genpytable.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scripts') 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 -- cgit