diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-09 15:15:07 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-09 15:15:07 +0800 |
commit | 520920c35ccbac3bfdca0aa76a0859a6edd8d528 (patch) | |
tree | 2506a2986ab70af48c5c67a4ae96b922265bc6f2 /scripts | |
parent | af7acd67e0b8649c2dcd79b2de7d4a6b20446d29 (diff) | |
download | libpinyin-520920c35ccbac3bfdca0aa76a0859a6edd8d528.tar.gz libpinyin-520920c35ccbac3bfdca0aa76a0859a6edd8d528.tar.xz libpinyin-520920c35ccbac3bfdca0aa76a0859a6edd8d528.zip |
fixes load_phrase
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.data | 3 | ||||
-rw-r--r-- | scripts/specialtable.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/scripts/Makefile.data b/scripts/Makefile.data index 830e294..9a2be87 100644 --- a/scripts/Makefile.data +++ b/scripts/Makefile.data @@ -2,7 +2,8 @@ all: pinyins.txt pinyins.txt: - awk -f genpinyins.awk -vlen=1 ../data/gb_char.table > $@ + awk -f genpinyins.awk -vlen=1 ../data/gb_char.table \ + ../data/gbk_char.table > $@ awk -f genpinyins.awk -vlen=2 ../data/gb_char.table >> $@ diff --git a/scripts/specialtable.py b/scripts/specialtable.py index a71aed7..9f03904 100644 --- a/scripts/specialtable.py +++ b/scripts/specialtable.py @@ -50,6 +50,8 @@ def load_phrase(filename): second_key = second_key[:-1] phrase_dict[(first_key, second_key)] = freq else: + if pinyin_str[-1].isdigit(): + pinyin_str = pinyin_str[:-1] phrase_dict[pinyin_str] = freq phrasefile.close() |