1 /*
2  *  $Id: py_table.c,v 1.4 2005/04/10 15:26:37 aonoto Exp $
3  */
4 
5 /*
6  * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
7  * This file is part of FreeWnn.
8  *
9  * Copyright Kyoto University Research Institute for Mathematical Sciences
10  *                 1987, 1988, 1989, 1990, 1991, 1992
11  * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
12  * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
13  * Copyright FreeWnn Project 1999, 2000
14  *
15  * Maintainer:  FreeWnn Project   <freewnn@tomo.gr.jp>
16  *
17  * This library is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU Lesser General Public
19  * License as published by the Free Software Foundation; either
20  * version 2 of the License, or (at your option) any later version.
21  *
22  * This library is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25  * Lesser General Public License for more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the
29  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
30  * Boston, MA 02111-1307, USA.
31  */
32 
33 /**  cWnn  Version 1.1   **/
34 
35 #include  <ctype.h>
36 #include "commonhd.h"
37 #ifdef CHINESE
38 #include "cplib.h"
39 
40 /* pyshengmu_tbl[]: ShengMu table of Chinese PinYin */
41 char *py_shengmu_tbl[PY_NUM_SHENGMU] = {
42 	"", "B", "C", "Ch", "D",
43 	"F", "G", "H", "J", "K",
44 	"L", "M", "N", "P", "Q",
45 	"R", "S", "Sh", "T", "W",
46 	"X", "Y", "Z", "Zh"
47 };
48 
49 /* py_yunmu_tbl[]: YunMu table of Chinese ZhuYin */
50 char *py_yunmu_tbl[PY_NUM_YUNMU * 5] = {
51 	"��", "��", "��", "��", "��",
52 	"a��", "����", "����", "����", "����",
53 	"ai��", "��i��", "��i��", "��i��", "��i��",
54 	"an��", "��n��", "��n��", "��n��", "��n��",
55 	"ang��", "��ng��", "��ng��", "��ng��", "��ng��",
56 	"ao��", "��o��", "��o��", "��o��", "��o��",
57 	"e��", "����", "����", "����", "����",
58 	"ei��", "��i��", "��i��", "��i��", "��i��",
59 	"en��", "��n��", "��n��", "��n��", "��n��",
60 	"eng��", "��ng��", "��ng��", "��ng��", "��ng��",
61 	"er��", "��r��", "��r��", "��r��", "��r��",
62 	"i��", "����", "����", "����", "����",
63 	"ia��", "i����", "i����", "i����", "i����",
64 	"ian��", "i��n��", "i��n��", "i��n��", "i��n��",
65 	"iang��", "i��ng��", "i��ng��", "i��ng��", "i��ng��",
66 	"iao��", "i��o��", "i��o��", "i��o��", "i��o��",
67 	"ie��", "i����", "i����", "i����", "i����",
68 	"in��", "��n��", "��n��", "��n��", "��n��",
69 	"ing��", "��ng��", "��ng��", "��ng��", "��ng��",
70 	"iong��", "i��ng��", "i��ng��", "i��ng��", "i��ng��",
71 	"iu��", "i����", "i����", "i����", "i����",
72 	"m��", "m��", "m��", "m��", "m��",
73 	"n��", "n��", "����", "����", "����",
74 	"ng��", "ng��", "ng��", "ng��", "ng��",
75 	"o��", "����", "����", "����", "����",
76 	"ong��", "��ng��", "��ng��", "��ng��", "��ng��",
77 	"ou��", "��u��", "��u��", "��u��", "��u��",
78 	"u��", "����", "����", "����", "����",
79 	"ua��", "u����", "u����", "u����", "u����",
80 	"uai��", "u��i��", "u��i��", "u��i��", "u��i��",
81 	"uan��", "u��n��", "u��n��", "u��n��", "u��n��",
82 	"uang��", "u��ng��", "u��ng��", "u��ng��", "u��ng��",
83 	"ue��", "u����", "u����", "u����", "u����",
84 	"ui��", "u����", "u����", "u����", "u����",
85 	"un��", "��n��", "��n��", "��n��", "��n��",
86 	"uo��", "u����", "u����", "u����", "u����",
87 	"����", "����", "����", "����", "����",
88 	"��e��", "������", "������", "������", "������",
89 	"0��", "1��", "2��", "3��", "4��",    /* for undefinited YunMu  */
90 };
91 
92 /* pinyin_tbl:  size is NUM_SHENG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