-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
365 lines (259 loc) · 12.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
_ _
___| |__ _____ _(_)_ __ __ _
/ __| '_ \ / _ \ \ /\ / / | '_ \ / _` |
| (__| | | | __/\ V V /| | | | | (_| |
\___|_| |_|\___| \_/\_/ |_|_| |_|\__, |
|___/
libchewing - The intelligent phonetic input method library
http://chewing.im/
[-] Summary
The Chewing (酷音) input method is an intelligent phonetic (Zhuyin/Bopomofo)
input method. It is one of the most popular input methods among Traditional
Chinese users. Chewing was inspired by other proprietary intelligent Zhuyin
input methods under Microsoft Windows, namely, Wang-Xin by Eten, Microsoft New
Zhuyin, and Nature Zhuyin.
The Chewing core team extended their work and actively maintains the project
as full open source efforts.
Website: http://chewing.im/
Mailing lists:
- Development: http://groups.google.com/group/chewing-devel
- General: http://groups.google.com/group/chewing
Issue tracker: http://code.google.com/p/chewing/issues/list
[-] History
libchewing is derived from Chewing input method, a xcin module focusing on
intelligent phonetic (Bopomofo/Zhuyin) processing by Lu-chuan Kung (lckung)
and Kang-pen Chen (kpchen) sponsored by Tsan-sheng Hsu from Academia Sinica
during 1999-2001. However, the original authors of Chewing dropped its
development, and Chewing was highly coupled with xcin, which prevents from
comprehensive applications. There was a similar input method, bimsphone,
which was bundled in XCIN server. However, it did not provide a convenient
API for further development, either.
[-] Motivation
Jim Huang, et al. formed the Chewing core team and extended Kung and Chen's
work since 2002. The chewing core team renamed the project as "new" chewing
to differentiate their work from the original. Nevertheless, the English name
has remained "chewing", which is identified by various input method framework
as well.
In 2004, Chewing core team successfully ported the input method to several
platforms and framework along with community collaboration.
[-] Development Goal of libchewing
- Split logic and view.
- Support multiple operating systems, and input framework.
- Provide a universal API for input framework and further development.
[-] Status
1. System bridge integration
Chewing has been adopted by various input frameworks in Unix-like systems and
even Microsoft Windows. On these systems, the chewing package is usually
split into two parts: libchewing, which handles the actual character selection
logic; and input framework interface for display and preference setting.
The active integration:
- JMCCE
- SCIM
- standalone Microsoft Windows 32/64-bit (windows-chewing)
- UIM
- ibus
- UCIMF
- mozc
- gcin/HIME
- fcitx
The inactive one:
- xcin
- IIIMF
- MacOS X (SpaceChewing)
- Sun's Java Desktop System Input Method Framework
- OpenVanilla Input Method Framework (previous than version 1.0)
- OXIM
2. support phonetic keyboard layout
- Hsu
- IBM
- Gin-Yieh
- Eten
- Eten 26 keys
- Dvorak
- Dvorak Hsu
- HanYu PinYin
- Taiwan Huayu Luomapinyin
- MPS2 Pinyin
3. External and unmerged projects
libchewing provides straightforward API and design, which enables third-party
projects to deploy the innovative. Here are the examples:
* FreeArray: utilizing libchewing for selecting phrases of Array input
method.
https://github.com/shaform/libfreearray
https://github.com/shaform/ibus-freearray
* CitC (Chewing in the Cloud): extending cloud services for real-time
training and phrase selection based on Chewing IM.
https://code.google.com/p/citc/
* KindleChewing: Chewing IM for Kindle DX device
https://github.com/tjwei/KindleChewing
* NTNU-Master Input Method: A Faster Chinese IM based on windows-chewing
https://sites.google.com/site/ntnumaster001/
[-] Minimal Build Tools Requirement
The following tools are used to build libchewing. Not all tools are necessary
during building. For example, if the compiler you used is clang, gcc & Visual
Studio are not needed. The versions listed here is the minimal version known to
build libchewing. If any tools you use below this version, libchewing might not
be built.
Build tools:
- autoconf >= 2.67
- automake >= 1.11.6
- libtool >= 2.4.2
- cmake >= 2.8.8 (optional)
Toolchain / IDE:
- clang >= 3.2
- gcc >= 4.7.3
- Visual Studio Express 2012
Documentation tools:
- texinfo >= 4.12
[-] Continuous Integration (CI) Service
libchewing uses the following CI services:
- https://travis-ci.org/chewing/libchewing (testing)
- https://drone.io/github.com/chewing/libchewing (testing)
- https://coveralls.io/r/chewing/libchewing (coverage report)
- https://launchpad.net/~chewing/+archive/chewing (ubuntu PPA)
[-] Installation
# ./configure --prefix=/usr
(If you checkout from GIT, make sure running ./autogen.sh
before this.)
# make
# make install
see "INSTALL" for details.
[-] Cross-build
Example cross-build instructions:
# CC=arm-none-linux-gnueabi-gcc ./configure \
--host=arm-none-linux-gnueabi \
--disable-shared --enable-static
# make CC_FOR_BUILD=gcc
[-] Build on Windows with MinGW
To build libchewing on Windows, you need to setup MinGW and MSYS in your
system. The installer of MinGW and MSYS is in the following link:
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
In "Select Components" during installing, please select the following items:
- MinGW Compiler Suite -> C Compiler
- MSYS Basic System
After installing, execute <MinGW directory>\msys\1.0\msys.bat (default is
C:\MinGW\msys\1.0\msys.bat) to enter MSYS shell.
If you get the source from the git repository you need additional step
to make the source buildable; use the following commands to install
necessary packages.
- mingw-get install automake
- mingw-get install autoconf
- mingw-get install libtool
Now you have the build environment for libchewing. However, you need to check
the line end of source code is LF instead of CR/LF before running autogen.sh.
The easily way to do this is using git:
- git config core.autocrlf input
- rm -rf *
- git reset --hard
Now you can run the following commands in MSYS shell to build libchewing:
If you get the source from the git repository, run:
- autogen.sh
Then
- configure
- make
If you run testchewing.exe (available after `make check') you will
find that testchewing.exe cannot print the correct string. This is
because testchewing.exe prints the UTF-8 string, while Windows cannot
print it to console.
[-] Build with CMake
libchewing supports cmake (http://www.cmake.org/) build system. You can use the
following command to build with cmake:
- cmake .
- make
cmake is also the preferred way to build libchewing on Windows platform due to
better Windows integrated. You can use the following command to create Visual
Studio project in 32-bits Windows platform:
- cmake . -G "Visual Studio 11"
or the following command to create Visual Studio project in 64-bits Windows
platform:
- cmake . -G "Visual Studio 11 Win64" (64-bits Windows)
[-] Usage
( modified from http://code.google.com/p/ibus/wiki/ChewingUserGuide )
Chewing guides the user to input Chinese by its pronunciation, in the form of
either Bopomofo/Zhuyin[1] or Hanyu pinyin[2], as well as Chinese punctuation
marks and normal and full shape number and English alphabets.
The following sections assume you are using the default configuration, that is,
with default/DaChen Bopomofo keyboard layout, on an en_US keyboard, and default
key-binding.
= Glossary =
Preedit buffer: The places for storing your typing before sending to the
applications (such as firefox) you are using.
Mode: Mode determines how Chewing reacts on keyboard input.
= Editing mode =
This mode is for normal Chinese character and punctuation typing. You are more
likely working on this mode.
In this mode, alpha-numberic and punctuation marks are interpreted as either
Bopomofo symbols or punctuation marks. If the symbols can form Chinese
characters, it will choose the most suitable character according to the
context in preedit buffer.
It is recommended that you enter the whole Chinese sentences, so Chewing can
do auto-correction for you. If you like what you see, you can press Enter to
commit the characters in preedit buffer.
If something goes wrong, you can select the character by move your cursor
using {Left} or {Right}, then press {Down} to enter Candidate Selection mode
to choose words.
To prevent the auto-correction on certain phrase, you may press {Tab} to
break the auto-correction on the end of the sentence.
You can also remember the 2,3,4 words phrases by pressing {Ctrl-2}, {Ctrl-3},
and {Ctrl-4} on the end of the phrase.
Also note that Shift's behavior changes in this mode. Shift-(alpha number)
outputs corresponding Full shape Chinese symbols if "Easy symbol input" is
enabled; Or outputs corresponding number half shape lowercase English
alphabets if "Easy symbol input" is disabled.
Talking about inputing Chinese symbols, other then enable "Easy symbol input"
mode, you can also press {Ctrl-1} or {`} to open up a symbol selection dialog,
select the category, then use {Down} key to choose the symbols as you would do
for characters.
Key binding API name Functionality
----------- -------- -------------
Caps Lock chewing_handle_Capslock Toggle Temporary English sub-mode
Down chewing_handle_Down Enter Candidate Selection mode
Shift-Space chewing_handle_ShiftSpace Toggle Half/Full Shape sub-mode
Enter chewing_handle_Enter Commit the content in preedit buffer
to active application window
Tab chewing_handle_Tab Break the auto-correction.
Ctrl-1 chewing_handle_CtrlNum Open symbol selection dialog
Ctrl-2 chewing_handle_CtrlNum Remember 2-word phrase.
Ctrl-3 chewing_handle_CtrlNum Remember 3-word phrase.
Ctrl-4 chewing_handle_CtrlNum Remember 4-word phrase.
= Half/Full Shape sub-mode =
This sub-mode is for inputing half shape and full shape characters. Half shape
characters are essentially normal English characters; while the full shape
characters are full-width pretty symbols that resemble English characters.
Key binding API name Functionality
----------- -------- -------------
Shift-Space chewing_handle_ShiftSpace Toggle Half/Full Shape sub-mode
= Temporary English sub-mode =
This sub-mode is for temporary English inputting.
Key binding API name Functionality
----------- -------- -------------
Caps Lock chewing_handle_Capslock Toggle Temporary English sub-mode
= Candidate Selection mode =
This mode is for Choosing the candidate. Firstly, the longest phrases that fit
the pronunciation are shown, then the second shortest, till the single
characters. Pressing {Down} again to return to the longest phrases.
For example, after entering "w91o3g4". Pressing {Down} makes Chewing displays
3-word candidate "台北市"; pressing {Down} again makes Chewing displays 2-word
candidate "北市"; pressing {Down} again makes Chewing displays 1-word
candidates "市","是"; pressing {Down} again makes Chewing displays back the
3-word candidates "台北市";
Key binding API name Functionality
----------- -------- -------------
Down chewing_handle_Down Next bunch of candidates in
different length
Left chewing_handle_Left Previous page of candidates
Right chewing_handle_Right Next page of candidates
1, 2, ...0 chewing_handle_Default Select 1st, 2nd, ... 10th candidate
= Bypass mode =
This mode is on whenever the preedit buffer is empty. This allows you to use
movement keys (such as cursor keys and page up/page down) and popular key
binding (Ctrl-A, Ctrl-S).
For the brief usage of libchewing APIs, please check the simplified example
implemented in file contrib/simple-select.c
*1 http://en.wikipedia.org/wiki/Bopomofo
*2 http://en.wikipedia.org/wiki/Pinyin
[-] License
GNU LGPL (Lesser General Public License).
See "COPYING" for details.
[-] Authors & Contact Information
See "AUTHORS" for details.