summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-01-12 12:30:19 +0800
committerPeng Wu <alexepico@gmail.com>2012-01-12 12:33:47 +0800
commit84c8182ef24c30477c4a3733046c9df14de6426b (patch)
treef1bca7e9daa56adce08e5d8bd2d6dc7d15f36ffa /scripts
parentb7fade0d5b5b558973c0e9f400e87bd5ace381ea (diff)
downloadlibpinyin-84c8182ef24c30477c4a3733046c9df14de6426b.tar.gz
libpinyin-84c8182ef24c30477c4a3733046c9df14de6426b.tar.xz
libpinyin-84c8182ef24c30477c4a3733046c9df14de6426b.zip
update pinyin parser
Diffstat (limited to 'scripts')
-rw-r--r--scripts/specialtable.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/specialtable.py b/scripts/specialtable.py
index 41f9a26..89fa097 100644
--- a/scripts/specialtable.py
+++ b/scripts/specialtable.py
@@ -107,7 +107,11 @@ def gen_all_resplit():
def filter_resplit():
for (orig_first_key, orig_second_key, new_first_key, new_second_key) \
in gen_all_resplit():
- if not (new_first_key, new_second_key) in phrase_dict:
+ #do the reverse here, as libpinyin pinyin parser is different with
+ #ibus-pinyin's parser.
+ (orig_first_key, orig_second_key, new_first_key, new_second_key) = \
+ (new_first_key, new_second_key, orig_first_key, orig_second_key)
+ if (new_first_key, new_second_key) not in phrase_dict:
continue
orig_freq = 0
new_freq = phrase_dict[(new_first_key, new_second_key)]