diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.data | 4 | ||||
-rw-r--r-- | scripts/genspecialtable.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Makefile.data b/scripts/Makefile.data index 9a2be87..7b4fe0e 100644 --- a/scripts/Makefile.data +++ b/scripts/Makefile.data @@ -7,4 +7,8 @@ pinyins.txt: awk -f genpinyins.awk -vlen=2 ../data/gb_char.table >> $@ +update-header: + python3 genpinyinheader.py > ../src/storage/pinyin_parser_table.h + + .PHONY: pinyins.txt diff --git a/scripts/genspecialtable.py b/scripts/genspecialtable.py index 4393274..d109b57 100644 --- a/scripts/genspecialtable.py +++ b/scripts/genspecialtable.py @@ -56,6 +56,10 @@ def gen_divided_table(): in divided_list: (pinyin_key, first_key, second_key) = map \ (get_chewing_string, (pinyin_key, first_key, second_key)) + + if orig_freq >= new_freq: + assert orig_freq > 0, "Expected orig_freq > 0 here." + entry = '{{{0}, {1}, {2}, {3}, {4}}}'.format \ (pinyin_key, orig_freq, first_key, second_key, new_freq) entries.append(entry) |