summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-10-24 12:27:51 +0800
committerPeng Wu <alexepico@gmail.com>2011-10-24 12:27:51 +0800
commitc8c7f23307fd7f8c36573c101161cb4c9ea6646e (patch)
tree8ab1a381faa6a84fb07fbcfcce719c091833fcdd /scripts
parent880a5af5dca113b480c05bfea63fccbddd03a5d2 (diff)
downloadlibpinyin-c8c7f23307fd7f8c36573c101161cb4c9ea6646e.tar.gz
libpinyin-c8c7f23307fd7f8c36573c101161cb4c9ea6646e.tar.xz
libpinyin-c8c7f23307fd7f8c36573c101161cb4c9ea6646e.zip
use chewing to gen pinyin table
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bopomofo.py1
-rw-r--r--scripts/genpytable.py12
2 files changed, 10 insertions, 3 deletions
diff --git a/scripts/bopomofo.py b/scripts/bopomofo.py
index dd53ea1..bd0f448 100644
--- a/scripts/bopomofo.py
+++ b/scripts/bopomofo.py
@@ -3,7 +3,6 @@
#
# libpinyin - Library to deal with pinyin.
#
-# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2010 BYVoid <byvoid1@gmail.com>
# Copyright (C) 2011 Peng Wu <alexepico@gmail.com>
#
diff --git a/scripts/genpytable.py b/scripts/genpytable.py
index 31ce8ca..1b339c2 100644
--- a/scripts/genpytable.py
+++ b/scripts/genpytable.py
@@ -3,7 +3,6 @@
#
# libpinyin - Library to deal with pinyin.
#
-# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (C) 2011 Peng Wu <alexepico@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -33,6 +32,14 @@ def check_pinyin_chewing_map():
else:
print("pinyin %s has no chewing mapping", pinyin_key)
+'''
+ for pinyin_key in bopomofo.PINYIN_BOPOMOFO_MAP.keys():
+ if pinyin_key in pinyin.PINYIN_DICT.keys():
+ pass
+ else:
+ print(pinyin_key, get_chewing(pinyin_key))
+'''
+
def get_chewing(pinyin_key):
initial, middle, final = \
'CHEWING_ZERO_INITIAL', 'CHEWING_ZERO_MIDDLE', 'CHEWING_ZERO_FINAL'
@@ -83,6 +90,7 @@ def get_chewing(pinyin_key):
if __name__ == "__main__":
#pre-check here
check_pinyin_chewing_map()
+
#dump
- for pinyin_key in sorted(pinyin.PINYIN_DICT.keys()):
+ for pinyin_key in sorted(bopomofo.PINYIN_BOPOMOFO_MAP.keys()):
print (pinyin_key, get_chewing(pinyin_key))