summaryrefslogtreecommitdiffstats
path: root/scripts/chewing.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-10-21 11:15:56 +0800
committerPeng Wu <alexepico@gmail.com>2011-10-21 11:15:56 +0800
commitc1a2c8e0902f456e38c35168b5487ef2bb66d79d (patch)
tree713e4d568f588e15068a63fd245d03b4cfbbb61c /scripts/chewing.py
parent9f284c8544bc6ab3873c2b892986dc60011dc2b3 (diff)
downloadlibpinyin-c1a2c8e0902f456e38c35168b5487ef2bb66d79d.tar.gz
libpinyin-c1a2c8e0902f456e38c35168b5487ef2bb66d79d.tar.xz
libpinyin-c1a2c8e0902f456e38c35168b5487ef2bb66d79d.zip
add chewing.py
Diffstat (limited to 'scripts/chewing.py')
-rw-r--r--scripts/chewing.py73
1 files changed, 73 insertions, 0 deletions
diff --git a/scripts/chewing.py b/scripts/chewing.py
new file mode 100644
index 0000000..16ff97b
--- /dev/null
+++ b/scripts/chewing.py
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+# vim:set et sts=4 sw=4:
+#
+# libpinyin - Library to deal with pinyin.
+#
+# Copyright (C) 2011 Peng Wu <alexepico@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+ASCII_CHEWING_SHENGMU_MAP = {
+ "CHEWING_B":"ㄅ",
+ "CHEWING_C":"ㄘ",
+ "CHEWING_CH":"ㄔ",
+ "CHEWING_D":"ㄉ",
+ "CHEWING_F":"ㄈ",
+ "CHEWING_H":"ㄏ",
+ "CHEWING_G":"ㄍ",
+ "CHEWING_K":"ㄎ",
+ "CHEWING_J":"ㄐ",
+ "CHEWING_M":"ㄇ",
+ "CHEWING_N":"ㄋ",
+ "CHEWING_L":"ㄌ",
+ "CHEWING_R":"ㄖ",
+ "CHEWING_P":"ㄆ",
+ "CHEWING_Q":"ㄑ",
+ "CHEWING_S":"ㄙ",
+ "CHEWING_SH":"ㄕ",
+ "CHEWING_T":"ㄊ",
+ "CHEWING_X":"ㄒ",
+ "CHEWING_Z":"ㄗ",
+ "CHEWING_ZH":"ㄓ",
+}
+
+CHEWING_ASCII_SHENGMU_MAP = dict([(v, k) for k, v in ASCII_CHEWING_SHENGMU_MAP])
+
+ASCII_CHEWING_MIDDLE_MAP = {
+ "CHEWING_I":"ㄧ",
+ "CHEWING_U":"ㄨ",
+ "CHEWING_V":"ㄩ",
+}
+
+CHEWING_ASCII_MIDDLE_MAP = dict([(v, k) for k, v in ASCII_CHEWING_MIDDLE_MAP])
+
+ASCII_CHEWING_YUNMU_MAP = {
+ "CHEWING_A":"ㄚ",
+ "CHEWING_AI":"ㄞ",
+ "CHEWING_AN":"ㄢ",
+ "CHEWING_ANG":"ㄤ",
+ "CHEWING_AO":"ㄠ",
+ "CHEWING_E":"ㄜ",
+ "CHEWING_EI":"ㄟ",
+ "CHEWING_EN":"ㄣ",
+ "CHEWING_ENG":"ㄥ",
+ "CHEWING_ER":"ㄦ",
+ "CHEWING_NG":"ㄫ",
+ "CHEWING_O":"ㄛ",
+ "CHEWING_OU":"ㄡ",
+}
+
+CHEWING_ASCII_YUNMU_MAP = dict([(v, k) for k, v in ASCII_CHEWING_YUNMU_MAP])