From df2837d24720377aa807ae02daf6f72d4b73d6ee Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 10 Sep 2013 16:04:51 +0800 Subject: add check_rules --- scripts/genpinyintable.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/genpinyintable.py') 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() -- cgit