summaryrefslogtreecommitdiffstats
path: root/scripts/specialtable.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-02 14:29:32 +0800
committerPeng Wu <alexepico@gmail.com>2011-11-02 14:29:32 +0800
commit7486c26af092ed6b40c640cd1dbf99456ba51892 (patch)
treefd64421b5187fe736207603817ab2215eab31db4 /scripts/specialtable.py
parent50d6a3f57c46189daaf9e48a5420c1e7b8906273 (diff)
downloadlibpinyin-7486c26af092ed6b40c640cd1dbf99456ba51892.tar.gz
libpinyin-7486c26af092ed6b40c640cd1dbf99456ba51892.tar.xz
libpinyin-7486c26af092ed6b40c640cd1dbf99456ba51892.zip
begin to write gen special table
Diffstat (limited to 'scripts/specialtable.py')
-rw-r--r--scripts/specialtable.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/specialtable.py b/scripts/specialtable.py
index 928ca9e..6976bb7 100644
--- a/scripts/specialtable.py
+++ b/scripts/specialtable.py
@@ -77,11 +77,17 @@ def gen_all_resplit():
for yun in yunmu_list:
if yun not in pinyin_list:
continue
+ #check first new pinyin key
+ if not pinyin_key[:-1] in pinyin_list:
+ continue
+ #check second new pinyin key
new_pinyin_key = pinyin_key[-1] + yun
- # if new_pinyin in pinyin_list:
- yield pinyin_key, yun, pinyin_key[:-1], new_pinyin_key
+ if new_pinyin_key in pinyin_list:
+ yield pinyin_key, yun, pinyin_key[:-1], new_pinyin_key
elif pinyin_key[-1] in ["e"]:
- yield pinyin_key, "r", pinyin_key[:-1], "er"
+ #check first new pinyin key
+ if pinyin_key[:-1] in pinyin_list:
+ yield pinyin_key, "r", pinyin_key[:-1], "er"
def filter_resplit():