summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-09-10 16:04:51 +0800
committerPeng Wu <alexepico@gmail.com>2013-09-10 16:04:51 +0800
commitdf2837d24720377aa807ae02daf6f72d4b73d6ee (patch)
treec5af7717bc74250404b542e8cc2c16f9f357fea5
parent4fd8b010dd65f62b78898a316bb551c24cc65943 (diff)
downloadlibzhuyin-df2837d24720377aa807ae02daf6f72d4b73d6ee.tar.gz
libzhuyin-df2837d24720377aa807ae02daf6f72d4b73d6ee.tar.xz
libzhuyin-df2837d24720377aa807ae02daf6f72d4b73d6ee.zip
add check_rules
-rw-r--r--scripts/genpinyintable.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/genpinyintable.py b/scripts/genpinyintable.py
index a0ca846..029725f 100644
--- a/scripts/genpinyintable.py
+++ b/scripts/genpinyintable.py
@@ -196,6 +196,13 @@ def check_rule(correct, wrong):
assert False, "unknown rule format"
return True
+def check_rules(rules, specials):
+ for (correct, wrong) in rules:
+ check_rule(correct, wrong)
+ for (correct, wrong) in specials:
+ assert '*' in correct
+ check_rule(correct, wrong)
+
def handle_rules(bopomofo, corrects):
matches = []
for (correct, wrong) in corrects:
@@ -228,6 +235,8 @@ def gen_chewing_key_table():
#init code
filter_pinyin_list()
+check_rules(hsu_correct, hsu_correct_special)
+check_rules(eten26_correct, eten26_correct_special)
populate_more_bopomofo_index()
sort_all()