From c8c7f23307fd7f8c36573c101161cb4c9ea6646e Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 24 Oct 2011 12:27:51 +0800 Subject: use chewing to gen pinyin table --- scripts/bopomofo.py | 1 - scripts/genpytable.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/bopomofo.py b/scripts/bopomofo.py index dd53ea1..bd0f448 100644 --- a/scripts/bopomofo.py +++ b/scripts/bopomofo.py @@ -3,7 +3,6 @@ # # libpinyin - Library to deal with pinyin. # -# Copyright (c) 2007-2008 Peng Huang # Copyright (c) 2010 BYVoid # Copyright (C) 2011 Peng Wu # diff --git a/scripts/genpytable.py b/scripts/genpytable.py index 31ce8ca..1b339c2 100644 --- a/scripts/genpytable.py +++ b/scripts/genpytable.py @@ -3,7 +3,6 @@ # # libpinyin - Library to deal with pinyin. # -# Copyright (c) 2007-2008 Peng Huang # Copyright (C) 2011 Peng Wu # # This program is free software; you can redistribute it and/or modify @@ -33,6 +32,14 @@ def check_pinyin_chewing_map(): else: print("pinyin %s has no chewing mapping", pinyin_key) +''' + for pinyin_key in bopomofo.PINYIN_BOPOMOFO_MAP.keys(): + if pinyin_key in pinyin.PINYIN_DICT.keys(): + pass + else: + print(pinyin_key, get_chewing(pinyin_key)) +''' + def get_chewing(pinyin_key): initial, middle, final = \ 'CHEWING_ZERO_INITIAL', 'CHEWING_ZERO_MIDDLE', 'CHEWING_ZERO_FINAL' @@ -83,6 +90,7 @@ def get_chewing(pinyin_key): if __name__ == "__main__": #pre-check here check_pinyin_chewing_map() + #dump - for pinyin_key in sorted(pinyin.PINYIN_DICT.keys()): + for pinyin_key in sorted(bopomofo.PINYIN_BOPOMOFO_MAP.keys()): print (pinyin_key, get_chewing(pinyin_key)) -- cgit