diff options
author | Peng Wu <alexepico@gmail.com> | 2013-08-13 13:03:47 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-08-13 13:08:11 +0800 |
commit | 62ba27023933285f50406d5e22e042785ff1e1dd (patch) | |
tree | 63aff87d19ec923cc51aa43018c2d500a9e7ea15 | |
parent | 19fb957ae331396db3ce0551f21447d86e536b12 (diff) | |
download | libzhuyin-62ba27023933285f50406d5e22e042785ff1e1dd.tar.gz libzhuyin-62ba27023933285f50406d5e22e042785ff1e1dd.tar.xz libzhuyin-62ba27023933285f50406d5e22e042785ff1e1dd.zip |
rename to hanyu pinyin
-rw-r--r-- | scripts/bopomofo.py | 4 | ||||
-rw-r--r-- | scripts/genpinyintable.py | 2 | ||||
-rw-r--r-- | scripts/pinyin.py | 4 | ||||
-rw-r--r-- | scripts/pinyintable.py | 14 |
4 files changed, 12 insertions, 12 deletions
diff --git a/scripts/bopomofo.py b/scripts/bopomofo.py index d504ac1..0671b17 100644 --- a/scripts/bopomofo.py +++ b/scripts/bopomofo.py @@ -21,7 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -BOPOMOFO_PINYIN_MAP = { +BOPOMOFO_HANYU_PINYIN_MAP = { "ㄅ" : "b", "ㄅㄚ" : "ba", "ㄅㄛ" : "bo", @@ -455,7 +455,7 @@ BOPOMOFO_PINYIN_MAP = { "ㄫ" : "ng", } -PINYIN_BOPOMOFO_MAP = dict([(v, k) for k, v in BOPOMOFO_PINYIN_MAP.items()]) +HANYU_PINYIN_BOPOMOFO_MAP = dict([(v, k) for k, v in BOPOMOFO_HANYU_PINYIN_MAP.items()]) SPECIAL_INITIAL_SET = {'ci', 'chi', 'si', 'shi', 'zi', 'zhi', 'ri'} diff --git a/scripts/genpinyintable.py b/scripts/genpinyintable.py index 262ea28..1c7cf49 100644 --- a/scripts/genpinyintable.py +++ b/scripts/genpinyintable.py @@ -93,7 +93,7 @@ def gen_pinyin_index(): def gen_bopomofo_index(): entries = [] for (bopomofo_str, flags) in bopomofo_index: - pinyin_str = bopomofo.BOPOMOFO_PINYIN_MAP[bopomofo_str] + pinyin_str = bopomofo.BOPOMOFO_HANYU_PINYIN_MAP[bopomofo_str] index = [x[0] for x in content_table].index(pinyin_str) entry = '{{"{0}", {1}, {2}}}'.format(bopomofo_str, flags, index) entries.append(entry) diff --git a/scripts/pinyin.py b/scripts/pinyin.py index 6c4a2e0..8861b60 100644 --- a/scripts/pinyin.py +++ b/scripts/pinyin.py @@ -21,7 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. N_ = lambda x : x -PINYIN_DICT = { +HANYU_PINYIN_DICT = { "a" : 1, "ai" : 2, "an" : 3, "ang" : 4, "ao" : 5, "ba" : 6, "bai" : 7, "ban" : 8, "bang" : 9, "bao" : 10, "bei" : 11, "ben" : 12, "beng" : 13, "bi" : 14, "bian" : 15, @@ -119,7 +119,7 @@ PINYIN_DICT = { #~ "eng" : 411, "chua" : 412, "fe" : 413, "fiao" : 414, "liong" : 415 } -PINYIN_LIST = PINYIN_DICT.keys () +HANYU_PINYIN_LIST = HANYU_PINYIN_DICT.keys () SHENGMU_DICT = { diff --git a/scripts/pinyintable.py b/scripts/pinyintable.py index 4692bc5..081cd2d 100644 --- a/scripts/pinyintable.py +++ b/scripts/pinyintable.py @@ -25,12 +25,12 @@ import chewing import itertools -pinyin_list = sorted(bopomofo.PINYIN_BOPOMOFO_MAP.keys()) +pinyin_list = sorted(bopomofo.HANYU_PINYIN_BOPOMOFO_MAP.keys()) shengmu_list = sorted(pinyin.SHENGMU_LIST) def check_pinyin_chewing_map(): - for pinyin_key in pinyin.PINYIN_DICT.keys(): + for pinyin_key in pinyin.HANYU_PINYIN_DICT.keys(): if pinyin_key in pinyin_list: pass else: @@ -41,7 +41,7 @@ def get_chewing(pinyin_key): initial, middle, final = \ 'CHEWING_ZERO_INITIAL', 'CHEWING_ZERO_MIDDLE', 'CHEWING_ZERO_FINAL' assert pinyin_key != None - assert pinyin_key in bopomofo.PINYIN_BOPOMOFO_MAP + assert pinyin_key in bopomofo.HANYU_PINYIN_BOPOMOFO_MAP #handle 'w' and 'y' if pinyin_key[0] == 'w': @@ -50,7 +50,7 @@ def get_chewing(pinyin_key): initial = 'PINYIN_Y' #get chewing string - bopomofo_str = bopomofo.PINYIN_BOPOMOFO_MAP[pinyin_key] + bopomofo_str = bopomofo.HANYU_PINYIN_BOPOMOFO_MAP[pinyin_key] #handle bopomofo SPECIAL_INITIAL_SET if pinyin_key in bopomofo.SPECIAL_INITIAL_SET: @@ -94,14 +94,14 @@ def gen_pinyins(): #generate all pinyins in bopomofo for pinyin_key in pinyin_list: flags = [] - if pinyin_key in bopomofo.PINYIN_BOPOMOFO_MAP.keys(): + if pinyin_key in bopomofo.HANYU_PINYIN_BOPOMOFO_MAP.keys(): flags.append("IS_CHEWING") - if pinyin_key in pinyin.PINYIN_LIST or \ + if pinyin_key in pinyin.HANYU_PINYIN_LIST or \ pinyin_key in pinyin.SHENGMU_LIST: flags.append("IS_PINYIN") if pinyin_key in shengmu_list: flags.append("PINYIN_INCOMPLETE") - chewing_key = bopomofo.PINYIN_BOPOMOFO_MAP[pinyin_key] + chewing_key = bopomofo.HANYU_PINYIN_BOPOMOFO_MAP[pinyin_key] if chewing_key in chewing.CHEWING_ASCII_INITIAL_MAP and \ pinyin_key not in bopomofo.SPECIAL_INITIAL_SET: flags.append("CHEWING_INCOMPLETE") |