diff options
author | Hiroshi Sumita <hsumita@chromium.org> | 2012-07-11 10:34:31 -0400 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2012-08-02 10:25:28 -0400 |
commit | d2b27c5dc5ad1070f502768a32df2792c55b435d (patch) | |
tree | 7f33c56f373961f1ec6bca9633ff468cefb70373 /scripts/double.py | |
parent | f01f78c88832dc4165f7bd822b7289fc3d7f98a8 (diff) | |
download | ibus-pinyin-d2b27c5dc5ad1070f502768a32df2792c55b435d.tar.gz |
Integrates pyzy.
BUG=None
TEST=None at this moment...
Review URL: https://codereview.appspot.com/6253043
Patch from Hiroshi Sumita <hsumita@chromium.org>.
Diffstat (limited to 'scripts/double.py')
-rw-r--r-- | scripts/double.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/double.py b/scripts/double.py deleted file mode 100644 index 58ad664..0000000 --- a/scripts/double.py +++ /dev/null @@ -1,40 +0,0 @@ -import pydict - -for name, (sheng, yun) in pydict.SHUANGPIN_SCHEMAS: - print "static const gint8 double_pinyin_%s_sheng[] = {" % name.lower() - for c in "abcdefghijklmnopqrstuvwxyz;": - s = sheng.get(c, "VOID") - if s == "'": - s = "ZERO" - else: - s = s.upper() - if s == "VOID" and c in ("a", "e", "o"): - s = "AEO" - print " PINYIN_ID_%s // %s" % ((s + ",").ljust(5), c.upper()) - print "};" - - print "static const gint8 double_pinyin_%s_yun[][2] = {" % name.lower() - for c in "abcdefghijklmnopqrstuvwxyz;": - s = yun.get(c, ("VOID", "VOID")) - if len(s) == 1: - s1 = s[0] - s2 = "VOID" - else: - s1, s2 = s - if s1 == "'": - s1 = "ZERO" - if s2 == "'": - s2 = "ZERO" - s1 = s1.upper() - s2 = s2.upper() - print " { PINYIN_ID_%s PINYIN_ID_%s }, // %s" % ((s1 + ",").ljust(5), s2.ljust(4), c.upper()) - print "};" - -print ''' -static const struct { - const gint8 (&sheng)[27]; - const gint8 (&yun)[27][2]; -} double_pinyin_map [] = {''' -for name, (sheng, yun) in pydict.SHUANGPIN_SCHEMAS: - print " { double_pinyin_%s_sheng, double_pinyin_%s_yun}," % (name.lower(), name.lower()) -print "};" |