~ubuntu-branches/ubuntu/saucy/ibus-pinyin/saucy-proposed

« back to all changes in this revision

Viewing changes to src/Types.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing, Asias He
  • Date: 2010-09-08 21:38:54 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100908213854-q4wlx8zlcyqxvelz
Tags: 1.3.11-1
[ Asias He ]
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* vim:set et ts=4 sts=4:
2
 
 *
3
 
 * ibus-pinyin - The Chinese PinYin engine for IBus
4
 
 *
5
 
 * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 2, or (at your option)
10
 
 * any later version.
11
 
 *
12
 
 * This program is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
 */
21
 
#ifndef __PY_TYPES_H_
22
 
#define __PY_TYPES_H_
23
 
 
24
 
#include <glib.h>
25
 
 
26
 
namespace PY {
27
 
 
28
 
#define PINYIN_ID_VOID  (-1)
29
 
#define PINYIN_ID_ZERO  (0)
30
 
#define PINYIN_ID_B     (1)
31
 
#define PINYIN_ID_C     (2)
32
 
#define PINYIN_ID_CH    (3)
33
 
#define PINYIN_ID_D     (4)
34
 
#define PINYIN_ID_F     (5)
35
 
#define PINYIN_ID_G     (6)
36
 
#define PINYIN_ID_H     (7)
37
 
#define PINYIN_ID_J     (8)
38
 
#define PINYIN_ID_K     (9)
39
 
#define PINYIN_ID_L     (10)
40
 
#define PINYIN_ID_M     (11)
41
 
#define PINYIN_ID_N     (12)
42
 
#define PINYIN_ID_P     (13)
43
 
#define PINYIN_ID_Q     (14)
44
 
#define PINYIN_ID_R     (15)
45
 
#define PINYIN_ID_S     (16)
46
 
#define PINYIN_ID_SH    (17)
47
 
#define PINYIN_ID_T     (18)
48
 
#define PINYIN_ID_W     (19)
49
 
#define PINYIN_ID_X     (20)
50
 
#define PINYIN_ID_Y     (21)
51
 
#define PINYIN_ID_Z     (22)
52
 
#define PINYIN_ID_ZH    (23)
53
 
#define PINYIN_ID_A     (24)
54
 
#define PINYIN_ID_AI    (25)
55
 
#define PINYIN_ID_AN    (26)
56
 
#define PINYIN_ID_ANG   (27)
57
 
#define PINYIN_ID_AO    (28)
58
 
#define PINYIN_ID_E     (29)
59
 
#define PINYIN_ID_EI    (30)
60
 
#define PINYIN_ID_EN    (31)
61
 
#define PINYIN_ID_ENG   (32)
62
 
#define PINYIN_ID_ER    (33)
63
 
#define PINYIN_ID_I     (34)
64
 
#define PINYIN_ID_IA    (35)
65
 
#define PINYIN_ID_IAN   (36)
66
 
#define PINYIN_ID_IANG  (37)
67
 
#define PINYIN_ID_IAO   (38)
68
 
#define PINYIN_ID_IE    (39)
69
 
#define PINYIN_ID_IN    (40)
70
 
#define PINYIN_ID_ING   (41)
71
 
#define PINYIN_ID_IONG  (42)
72
 
#define PINYIN_ID_IU    (43)
73
 
#define PINYIN_ID_O     (44)
74
 
#define PINYIN_ID_ONG   (45)
75
 
#define PINYIN_ID_OU    (46)
76
 
#define PINYIN_ID_U     (47)
77
 
#define PINYIN_ID_UA    (48)
78
 
#define PINYIN_ID_UAI   (49)
79
 
#define PINYIN_ID_UAN   (50)
80
 
#define PINYIN_ID_UANG  (51)
81
 
#define PINYIN_ID_UE    (52)
82
 
#define PINYIN_ID_VE    PINYIN_ID_UE
83
 
#define PINYIN_ID_UI    (53)
84
 
#define PINYIN_ID_UN    (54)
85
 
#define PINYIN_ID_UO    (55)
86
 
#define PINYIN_ID_V     (56)
87
 
#define PINYIN_ID_NG    PINYIN_ID_VOID
88
 
 
89
 
#define PINYIN_INCOMPLETE_PINYIN    (1U << 0)
90
 
 
91
 
#define PINYIN_CORRECT_GN_TO_NG     (1U << 1)
92
 
#define PINYIN_CORRECT_MG_TO_NG     (1U << 2)
93
 
#define PINYIN_CORRECT_IOU_TO_IU    (1U << 3)
94
 
#define PINYIN_CORRECT_UEI_TO_UI    (1U << 4)
95
 
#define PINYIN_CORRECT_UEN_TO_UN    (1U << 5)
96
 
#define PINYIN_CORRECT_UE_TO_VE     (1U << 6)
97
 
#define PINYIN_CORRECT_V_TO_U       (1U << 7)
98
 
#define PINYIN_CORRECT_ALL          (0x000000fe)
99
 
 
100
 
#define PINYIN_FUZZY_C_CH           (1U << 8)
101
 
#define PINYIN_FUZZY_CH_C           (1U << 9)
102
 
#define PINYIN_FUZZY_Z_ZH           (1U << 10)
103
 
#define PINYIN_FUZZY_ZH_Z           (1U << 11)
104
 
#define PINYIN_FUZZY_S_SH           (1U << 12)
105
 
#define PINYIN_FUZZY_SH_S           (1U << 13)
106
 
#define PINYIN_FUZZY_L_N            (1U << 14)
107
 
#define PINYIN_FUZZY_N_L            (1U << 15)
108
 
#define PINYIN_FUZZY_F_H            (1U << 16)
109
 
#define PINYIN_FUZZY_H_F            (1U << 17)
110
 
#define PINYIN_FUZZY_L_R            (1U << 18)
111
 
#define PINYIN_FUZZY_R_L            (1U << 19)
112
 
#define PINYIN_FUZZY_K_G            (1U << 20)
113
 
#define PINYIN_FUZZY_G_K            (1U << 21)
114
 
 
115
 
#define PINYIN_FUZZY_AN_ANG         (1U << 22)
116
 
#define PINYIN_FUZZY_ANG_AN         (1U << 23)
117
 
#define PINYIN_FUZZY_EN_ENG         (1U << 24)
118
 
#define PINYIN_FUZZY_ENG_EN         (1U << 25)
119
 
#define PINYIN_FUZZY_IN_ING         (1U << 26)
120
 
#define PINYIN_FUZZY_ING_IN         (1U << 27)
121
 
#define PINYIN_FUZZY_IAN_IANG       (1U << 28)
122
 
#define PINYIN_FUZZY_IANG_IAN       (1U << 29)
123
 
#define PINYIN_FUZZY_UAN_UANG       (1U << 30)
124
 
#define PINYIN_FUZZY_UANG_UAN       (1U << 31)
125
 
#define PINYIN_FUZZY_ALL            (0xffffff00)
126
 
 
127
 
struct Pinyin {
128
 
    const gchar *text;
129
 
    const wchar_t *bopomofo;
130
 
    const gchar *sheng;
131
 
    const gchar *yun;
132
 
    struct {
133
 
        guint8 sheng;
134
 
        guint8 yun;
135
 
    } pinyin_id[3];
136
 
    const guint len;
137
 
    const guint flags;
138
 
};
139
 
 
140
 
#define MAX_UTF8_LEN 6
141
 
#define MAX_PHRASE_LEN 16
142
 
 
143
 
};
144
 
 
145
 
#endif