diff options
author | Peng Wu <alexepico@gmail.com> | 2012-01-05 11:17:49 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-01-05 11:20:20 +0800 |
commit | 69a66088a60c6ae03462f8fba49383e5b4772b46 (patch) | |
tree | 2d13c08f75066ea7958c1b307d7a9185a09cd791 /scripts/pinyintable.py | |
parent | 8af616069b4805d43dc554a33d7d4503f9a87782 (diff) | |
download | libpinyin-69a66088a60c6ae03462f8fba49383e5b4772b46.tar.gz libpinyin-69a66088a60c6ae03462f8fba49383e5b4772b46.tar.xz libpinyin-69a66088a60c6ae03462f8fba49383e5b4772b46.zip |
fixes chewing index
Diffstat (limited to 'scripts/pinyintable.py')
-rw-r--r-- | scripts/pinyintable.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/pinyintable.py b/scripts/pinyintable.py index a1d8d3e..33b5e9c 100644 --- a/scripts/pinyintable.py +++ b/scripts/pinyintable.py @@ -53,8 +53,8 @@ def get_chewing(pinyin_key): #get chewing string bopomofo_str = bopomofo.PINYIN_BOPOMOFO_MAP[pinyin_key] - #handle 'ci', 'chi', 'si', 'shi', 'zi', 'zhi', 'ri' - if pinyin_key in {'ci', 'chi', 'si', 'shi', 'zi', 'zhi', 'ri'}: + #handle bopomofo SPECIAL_INITIAL_SET + if pinyin_key in bopomofo.SPECIAL_INITIAL_SET: middle = "CHEWING_I" #normal process for char in bopomofo_str: @@ -105,7 +105,8 @@ def gen_pinyins(): if pinyin_key in shengmu_list: flags.append("PINYIN_INCOMPLETE") chewing_key = bopomofo.PINYIN_BOPOMOFO_MAP[pinyin_key] - if chewing_key in chewing.CHEWING_ASCII_INITIAL_MAP: + if chewing_key in chewing.CHEWING_ASCII_INITIAL_MAP and \ + pinyin_key not in bopomofo.SPECIAL_INITIAL_SET: flags.append("CHEWING_INCOMPLETE") yield pinyin_key, pinyin_key, chewing_key, \ flags, get_chewing(pinyin_key) |