summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-03 14:45:37 +0800
committerPeng Wu <alexepico@gmail.com>2011-11-03 14:45:37 +0800
commite4fa71454b95d5f3b13e5e43fa6788d2bd3bfb02 (patch)
treee00a6b74c85a7e2305f52c117cdf5abb8dd85304
parent146d3c7185b6beafac1f1f818e638f32f2b9b743 (diff)
downloadlibpinyin-e4fa71454b95d5f3b13e5e43fa6788d2bd3bfb02.tar.gz
libpinyin-e4fa71454b95d5f3b13e5e43fa6788d2bd3bfb02.tar.xz
libpinyin-e4fa71454b95d5f3b13e5e43fa6788d2bd3bfb02.zip
fixes a typo
-rw-r--r--scripts/genpinyintable.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/genpinyintable.py b/scripts/genpinyintable.py
index 1a325be..e90b104 100644
--- a/scripts/genpinyintable.py
+++ b/scripts/genpinyintable.py
@@ -54,7 +54,7 @@ def sort_all():
bopomofo_index = sorted(bopomofo_index, key=sortfunc)
-def gen_context_table():
+def gen_content_table():
entries = []
for ((correct, bopomofo, chewing)) in content_table:
entry = '{{"{0}", "{1}", {2}}}'.format(correct, bopomofo, chewing)
@@ -74,7 +74,7 @@ def gen_pinyin_index():
def gen_bopomofo_index():
entries = []
for (bopomofo_str, flags, bopomofo) in bopomofo_index:
- index = [x[0] for x in content_table].index(bopomofo)
+ index = [x[1] for x in content_table].index(bopomofo)
entry = '{{"{0}", {1}, {2}}}'.format(bopomofo_str, flags, index)
entries.append(entry)
return ',\n'.join(entries)
@@ -84,5 +84,5 @@ def gen_bopomofo_index():
if __name__ == "__main__":
filter_pinyin_list()
sort_all()
- s = gen_pinyin_index()
+ s = gen_content_table() + gen_pinyin_index() + gen_bopomofo_index()
print(s)