summaryrefslogtreecommitdiffstats
path: root/scripts/genspecialtable.py
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/genspecialtable.py
parent7027b77680b25eca4c4b5041c2c9ecd8cc0149e2 (diff)
downloadlibpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.tar.gz
libpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.tar.xz
libpinyin-bcebd6b9e4ffb3c62e0b7dacf3abe4fb872c6243.zip
update Makefile.data and genspecialtable.py
Diffstat (limited to 'scripts/genspecialtable.py')
-rw-r--r--scripts/genspecialtable.py4
1 files changed, 4 insertions, 0 deletions
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)