1 # -*- coding: utf-8 -*-
2 # vim:set et sts=4 sw=4:
4 # libpinyin - Library to deal with pinyin.
6 # Copyright (c) 2010 BYVoid <byvoid1@gmail.com>
7 # Copyright (C) 2011 Peng Wu <alexepico@gmail.com>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 BOPOMOFO_PINYIN_MAP = {
458 PINYIN_BOPOMOFO_MAP = dict([(v, k) for k, v in BOPOMOFO_PINYIN_MAP.items()])
460 SPECIAL_INITIAL_SET = {'ci', 'chi', 'si', 'shi', 'zi', 'zhi', 'ri'}
463 SHENG_YUN_BOPOMOFO_MAP = {
486 # 韻母為u,ue,un,uan,ong時ㄧ省略
487 "y" : ("ㄧ", (("u", "ue", "un", "uan", "ong"), "")),
491 "e" : ("ㄜ", ("y", "ㄝ")), # y後面為ㄝ
493 # zh ch sh r z c s y後面為空
494 "i" : ("ㄧ", (("zh", "ch", "sh", "r", "z", "c", "s", "y"), "")),
497 "u" : ("ㄨ", ("jqxy", "ㄩ")),
514 "in" : ("ㄧㄣ", ("y", "ㄣ")), #y後面為ㄣ
516 "ing" : ("ㄧㄥ", ("y", "ㄥ")), #y後面為ㄥ
524 "uan" : ("ㄨㄢ", ("jqxy", "ㄩㄢ")), # jqxy後面是ㄩㄢ
525 "un" : ("ㄨㄣ", ("jqxy", "ㄩㄣ")), # jqxy後面是ㄩㄣ
526 "uang" : ("ㄨㄤ", ("jqxy", "ㄩㄤ")), # jqxy後面是ㄩㄤ
527 "ong" : ("ㄨㄥ", ("jqxy", "ㄩㄥ")), # y後面為ㄩㄥ