summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-09 15:19:16 +0800
committerPeng Wu <alexepico@gmail.com>2011-11-09 15:21:45 +0800
commitbcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243 (patch)
treeb8081452d1ae329c79b7ff7a1f55dcf595ffcdf4 /scripts
parent7027b77680b25eca4c4b5041c2c9ecd8cc0149e2 (diff)
downloadlibpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.tar.gz
libpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.tar.xz
libpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.zip
update Makefile.data and genspecialtable.py
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.data4
-rw-r--r--scripts/genspecialtable.py4
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)