From 520920c35ccbac3bfdca0aa76a0859a6edd8d528 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 9 Nov 2011 15:15:07 +0800 Subject: fixes load_phrase --- scripts/Makefile.data | 3 ++- scripts/specialtable.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') 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() -- cgit