(vowel): Don't yield U+0F70 by "a".
[m17n/m17n-db.git] / ko-han2.mim
1 ;; ko-han2.mim -- Input method for Korean Hangul
2 ;; Copyright (C) 2003, 2004
3 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
4 ;;   Registration Number H15PRO112
5
6 ;; This file is part of the m17n database; a sub-part of the m17n
7 ;; library.
8
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
13
14 ;; The m17n library 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 GNU
17 ;; Lesser General Public License for more details.
18
19 ;; You should have received a copy of the GNU Lesser General Public
20 ;; License along with the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
23
24 ;;; Hangul input method with 2벌식.
25 ;;; @htmlonly
26 ;;; This input method uses this keyboard layout:
27 ;;; <table border="1" cellspacing="0" cellpadding=="0">
28 ;;; ||KEY: |r |R |s |e |E |f |a |q |Q |t |T |d |w |W |c |z |x |v |g
29 ;;;        |k |i |j |p |P |u |h |y |n |b |m |l |o |O ||
30 ;;; ||한글:|ㄱ|ㄲ|ㄴ|ㄷ|ㄸ|ㄹ|ㅁ|ㅂ|ㅃ|ㅅ|ㅆ|ㅇ|ㅈ|ㅉ|ㅊ|ㅋ|ㅌ|ㅍ|ㅎ
31 ;;;        |ㅏ|ㅑ|ㅓ|ㅔ|ㅖ|ㅕ|ㅗ|ㅛ|ㅜ|ㅠ|ㅡ|ㅣ|ㅐ|ㅒ||
32 ;;; </table>
33 ;;; @endhtmlonly
34
35 (input-method ko han2)
36
37 (title "한2")
38
39 (description
40  "Hangul input method with 2벌식.
41 This input method uses this keyboard layout:
42   KEY:  r R s e E f a q Q t T d w W c z x v g k i j p P u h y n b m l o O
43   한글:ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅑㅓㅔㅖㅕㅗㅛㅜㅠㅡㅣㅐㅒ
44 ")
45
46 (macro
47  (compose
48   ;; Convert Jamo sequence LV[T] into a precomposed character.
49   ;; See the Unicode Standard Version 3.0, Section 3.11.
50   (> L 0
51      ((set LIndex L) (sub LIndex 0x1100)
52       (set VIndex V) (sub VIndex 0x1161)
53       (set TIndex T) (sub TIndex 0x11A7)
54       ;; S = (LIndex * VCount + Vindex) * TCount + TIndex + SBase
55       (set S LIndex)
56       (mul S 21) ;; VCount
57       (add S VIndex)
58       (mul S 28) ;; TCount
59       (add S TIndex)
60       (add S 0xAC00) ;; SBase
61       (delete @<)
62       (insert S)))))
63
64 (map
65  (L-or-T-head
66   ("q") ("Q") ("w") ("W") ("e") ("E") ("r") ("R") ("t") ("T")
67   ("a") ("s") ("S") ("d") ("D") ("f") ("F") ("g") ("G")
68   ("z") ("x") ("c") ("C") ("v"))
69
70  (L-or-T
71   ;; Set L1 to CHOSEONG, T to JONGSEONG.
72   ("r" (set L1 ?ᄀ) (set T ?ᆨ) ?ㄱ (compose))
73   ("R" (set L1 ?ᄁ) (set T ?ᆩ) ?ㄲ (compose))
74   ("s" (set L1 ?ᄂ) (set T ?ᆫ) ?ㄴ (compose))
75   ("e" (set L1 ?ᄃ) (set T ?ᆮ) ?ㄷ (compose))
76   ("f" (set L1 ?ᄅ) (set T ?ᆯ) ?ㄹ (compose))
77   ("a" (set L1 ?ᄆ) (set T ?ᆷ) ?ㅁ (compose))
78   ("q" (set L1 ?ᄇ) (set T ?ᆸ) ?ㅂ (compose))
79   ("t" (set L1 ?ᄉ) (set T ?ᆺ) ?ㅅ (compose))
80   ("T" (set L1 ?ᄊ) (set T ?ᆻ) ?ㅆ (compose))
81   ("d" (set L1 ?ᄋ) (set T ?ᆼ) ?ㅇ (compose))
82   ("w" (set L1 ?ᄌ) (set T ?ᆽ) ?ㅈ (compose))
83   ("c" (set L1 ?ᄎ) (set T ?ᆾ) ?ㅊ (compose))
84   ("z" (set L1 ?ᄏ) (set T ?ᆿ) ?ㅋ (compose))
85   ("x" (set L1 ?ᄐ) (set T ?ᇀ) ?ㅌ (compose))
86   ("v" (set L1 ?ᄑ) (set T ?ᇁ) ?ㅍ (compose))
87   ("g" (set L1 ?ᄒ) (set T ?ᇂ) ?ㅎ (compose))
88   ("sr" (set L1 ?ᄓ) (set T ?ᇅ) ?ᄓ (compose))
89   ("se" (set L1 ?ᄕ) (set T ?ᇆ) ?ㅦ (compose))
90   ("er" (set L1 ?ᄗ) (set T ?ᇊ) ?ᄗ (compose))
91   ("fs" (set L1 ?ᄘ) (set T ?ᇍ) ?ᄘ (compose))
92   ("F" (set L1 ?ᄙ) (set T ?ᇐ) ?ᄙ (compose))
93   ("fg" (set L1 ?ᄚ) (set T ?ᆶ) ?ㅀ (compose))
94   ("aq" (set L1 ?ᄜ) (set T ?ᇜ) ?ㅮ (compose))
95   ("ad" (set L1 ?ᄝ) (set T ?ᇢ) ?ㅱ (compose))
96   ("qt" (set L1 ?ᄡ) (set T ?ᆹ) ?ㅄ (compose))
97   ("qv" (set L1 ?ᄪ) (set T ?ᇤ) ?ᄪ (compose))
98   ("qd" (set L1 ?ᄫ) (set T ?ᇦ) ?ㅸ (compose))
99   ("tr" (set L1 ?ᄭ) (set T ?ᇧ) ?ㅺ (compose))
100   ("te" (set L1 ?ᄯ) (set T ?ᇨ) ?ㅼ (compose))
101   ("tf" (set L1 ?ᄰ) (set T ?ᇩ) ?ᄰ (compose))
102   ("tq" (set L1 ?ᄲ) (set T ?ᇪ) ?ㅽ (compose))
103   ("t/" (set L1 ?ᅀ) (set T ?ᇫ) ?ㅿ (compose))
104   ("dr" (set L1 ?ᅁ) (set T ?ᇬ) ?ᅁ (compose))
105   ("dt" (set L1 ?ᅅ) (set T ?ᇱ) ?ㆂ (compose))
106   ("dt/" (set L1 ?ᅆ) (set T ?ᇲ) ?ㆃ (compose))
107   ("d/" (set L1 ?ᅌ) (set T ?ᇰ) ?ㆁ (compose))
108   ("vq" (set L1 ?ᅖ) (set T ?ᇳ) ?ᅖ (compose))
109   ("vd" (set L1 ?ᅗ) (set T ?ᇴ) ?ㆄ (compose))
110   ("g/" (set L1 ?ᅙ) (set T ?ᇹ) ?ㆆ (compose)))
111
112  (L
113   ;; Set L to CHOSEONG.
114   ("E" (set L ?ᄄ) ?ㄸ)
115   ("Q" (set L ?ᄈ) ?ㅃ)
116   ("W" (set L ?ᄍ) ?ㅉ)
117   ("S" (set L ?ᄔ) ?ㅥ)
118   ("sq" (set L ?ᄖ) ?ᄖ)
119   ("fd" (set L ?ᄛ) ?ᄛ)
120   ("qr" (set L ?ᄞ) ?ㅲ)
121   ("qs" (set L ?ᄟ) ?ᄟ)
122   ("qe" (set L ?ᄠ) ?ㅳ)
123   ("qtr" (set L ?ᄢ) ?ㅴ)
124   ("qte" (set L ?ᄣ) ?ㅵ)
125   ("qtq" (set L ?ᄤ) ?ᄤ)
126   ("qtt" (set L ?ᄥ) ?ᄥ)
127   ("qtw" (set L ?ᄦ) ?ᄦ)
128   ("qw" (set L ?ᄧ) ?ㅶ)
129   ("qc" (set L ?ᄨ) ?ᄨ)
130   ("qx" (set L ?ᄩ) ?ㅷ)
131   ("Qd" (set L ?ᄬ) ?ㅹ)
132   ("ts" (set L ?ᄮ) ?ㅻ)
133   ("ta" (set L ?ᄱ) ?ᄱ)
134   ("tqr" (set L ?ᄳ) ?ᄳ)
135   ("tT" (set L ?ᄴ) ?ᄴ)
136   ("td" (set L ?ᄵ) ?ᄵ)
137   ("tw" (set L ?ᄶ) ?ㅾ)
138   ("tc" (set L ?ᄷ) ?ᄷ)
139   ("tz" (set L ?ᄸ) ?ᄸ)
140   ("tx" (set L ?ᄹ) ?ᄹ)
141   ("tv" (set L ?ᄺ) ?ᄺ)
142   ("tg" (set L ?ᄻ) ?ᄻ)
143   ("tt" (set L ?ᄼ) ?ᄼ)
144   ("TT" (set L ?ᄽ) ?ᄽ)
145   ("tt/" (set L ?ᄾ) ?ᄾ)
146   ("TT/'" (set L ?ᄿ) ?ᄿ)
147   ("ds" (set L ?ᅂ) ?ᅂ)
148   ("da" (set L ?ᅃ) ?ᅃ)
149   ("dq" (set L ?ᅄ) ?ᅄ)
150   ("D" (set L ?ᅇ) ?ㆀ)
151   ("dw" (set L ?ᅈ) ?ᅈ)
152   ("dc" (set L ?ᅉ) ?ᅉ)
153   ("dx" (set L ?ᅊ) ?ᅊ)
154   ("dv" (set L ?ᅋ) ?ᅋ)
155   ("wd" (set L ?ᅍ) ?ᅍ)
156   ("ww" (set L ?ᅎ) ?ᅎ)
157   ("WW" (set L ?ᅏ) ?ᅏ)
158   ("ww/" (set L ?ᅐ) ?ᅐ)
159   ("WW/" (set L ?ᅑ) ?ᅑ)
160   ("cz" (set L ?ᅒ) ?ᅒ)
161   ("cg" (set L ?ᅓ) ?ᅓ)
162   ("cc" (set L ?ᅔ) ?ᅔ)
163   ("cc/" (set L ?ᅕ) ?ᅕ)
164   ("G" (set L ?ᅘ) ?ㆅ)
165   ("C" (set L ?ᅟ) ?ᅟ))
166
167  (V-head
168   ("y") ("u") ("i") ("o") ("p") ("O") ("P")
169   ("h") ("j") ("k") ("K") ("l")
170   ("b") ("n") ("m"))
171
172  (V
173   ;; Set V to JUNGSEONG.
174   ("k" (set V ?ᅡ) ?ㅏ (compose))
175   ("o" (set V ?ᅢ) ?ㅐ (compose))
176   ("i" (set V ?ᅣ) ?ㅑ (compose))
177   ("O" (set V ?ᅤ) ?ㅒ (compose))
178   ("j" (set V ?ᅥ) ?ㅓ (compose))
179   ("p" (set V ?ᅦ) ?ㅔ (compose))
180   ("u" (set V ?ᅧ) ?ㅕ (compose))
181   ("P" (set V ?ᅨ) ?ㅖ (compose))
182   ("h" (set V ?ᅩ) ?ㅗ (compose))
183   ("hk" (set V ?ᅪ) ?ㅘ (compose))
184   ("ho" (set V ?ᅫ) ?ㅙ (compose))
185   ("hl" (set V ?ᅬ) ?ㅚ (compose))
186   ("y" (set V ?ᅭ) ?ㅛ (compose))
187   ("n" (set V ?ᅮ) ?ㅜ (compose))
188   ("nj" (set V ?ᅯ) ?ㅝ (compose))
189   ("np" (set V ?ᅰ) ?ㅞ (compose))
190   ("nl" (set V ?ᅱ) ?ㅟ (compose))
191   ("b" (set V ?ᅲ) ?ㅠ (compose))
192   ("m" (set V ?ᅳ) ?ㅡ (compose))
193   ("ml" (set V ?ᅴ) ?ㅢ (compose))
194   ("l" (set V ?ᅵ) ?ㅣ (compose))
195   ("kh" (set V ?ᅶ) ?ᅶ (compose))
196   ("kn" (set V ?ᅷ) ?ᅷ (compose))
197   ("ih" (set V ?ᅸ) ?ᅸ (compose))
198   ("iy" (set V ?ᅹ) ?ᅹ (compose))
199   ("jh" (set V ?ᅺ) ?ᅺ (compose))
200   ("jn" (set V ?ᅻ) ?ᅻ (compose))
201   ("jm" (set V ?ᅼ) ?ᅼ (compose))
202   ("uh" (set V ?ᅽ) ?ᅽ (compose))
203   ("un" (set V ?ᅾ) ?ᅾ (compose))
204   ("hj" (set V ?ᅿ) ?ᅿ (compose))
205   ("hp" (set V ?ᆀ) ?ᆀ (compose))
206   ("hP" (set V ?ᆁ) ?ᆁ (compose))
207   ("hh" (set V ?ᆂ) ?ᆂ (compose))
208   ("hn" (set V ?ᆃ) ?ᆃ (compose))
209   ("yi" (set V ?ᆄ) ?ㆇ (compose))
210   ("yO" (set V ?ᆅ) ?ㆈ (compose))
211   ("yu" (set V ?ᆆ) ?ᆆ (compose))
212   ("yh" (set V ?ᆇ) ?ᆇ (compose))
213   ("yl" (set V ?ᆈ) ?ㆉ (compose))
214   ("nk" (set V ?ᆉ) ?ᆉ (compose))
215   ("no" (set V ?ᆊ) ?ᆊ (compose))
216   ("njm" (set V ?ᆋ) ?ᆋ (compose))
217   ("nu" (set V ?ᆌ) ?ᆌ (compose))
218   ("nn" (set V ?ᆍ) ?ᆍ (compose))
219   ("bk" (set V ?ᆎ) ?ᆎ (compose))
220   ("bj" (set V ?ᆏ) ?ᆏ (compose))
221   ("bp" (set V ?ᆐ) ?ᆐ (compose))
222   ("bu" (set V ?ᆑ) ?ㆊ (compose))
223   ("bP" (set V ?ᆒ) ?ㆋ (compose))
224   ("bn" (set V ?ᆓ) ?ᆓ (compose))
225   ("bl" (set V ?ᆔ) ?ㆌ (compose))
226   ("mn" (set V ?ᆕ) ?ᆕ (compose))
227   ("mm" (set V ?ᆖ) ?ᆖ (compose))
228   ("mln" (set V ?ᆗ) ?ᆗ (compose))
229   ("lk" (set V ?ᆘ) ?ᆘ (compose))
230   ("li" (set V ?ᆙ) ?ᆙ (compose))
231   ("lh" (set V ?ᆚ) ?ᆚ (compose))
232   ("ln" (set V ?ᆛ) ?ᆛ (compose))
233   ("lm" (set V ?ᆜ) ?ᆜ (compose))
234   ("lK" (set V ?ᆝ) ?ᆝ (compose))
235   ("K" (set V ?ᆞ) ?ᆞ (compose))
236   ("Kj" (set V ?ᆟ) ?ᆟ (compose))
237   ("Kn" (set V ?ᆠ) ?ᆠ (compose))
238   ("Kl" (set V ?ᆡ) ?ᆡ (compose))
239   ("KK" (set V ?ᆢ) ?ᆢ (compose)))
240
241  (T
242   ;; Set T to JONGSEONG.
243   ("rt" (set T ?ᆪ) ?ㄳ (compose))
244   ("sw" (set T ?ᆬ) ?ᆬ (compose))
245   ("sg" (set T ?ᆭ) ?ᆭ (compose))
246   ("fr" (set T ?ᆰ) ?ㄺ (compose))
247   ("fa" (set T ?ᆱ) ?ㄻ (compose))
248   ("fq" (set T ?ᆲ) ?ㄼ (compose))
249   ("ft" (set T ?ᆳ) ?ㄽ (compose))
250   ("fx" (set T ?ᆴ) ?ㄾ (compose))
251   ("fv" (set T ?ᆵ) ?ㄿ (compose))
252   ("rf" (set T ?ᇃ) ?ᇃ (compose))
253   ("rtr" (set T ?ᇄ) ?ᇄ (compose))
254   ("st" (set T ?ᇇ) ?ㅧ (compose))
255   ("st/" (set T ?ᇈ) ?ㅨ (compose))
256   ("sx" (set T ?ᇉ) ?ᇉ (compose))
257   ("ef" (set T ?ᇋ) ?ᇋ (compose))
258   ("frt" (set T ?ᇌ) ?ᇌ (compose))
259   ("fe" (set T ?ᇎ) ?ㅪ (compose))
260   ("feg" (set T ?ᇏ) ?ᇏ (compose))
261   ("far" (set T ?ᇑ) ?ᇑ (compose))
262   ("fat" (set T ?ᇒ) ?ᇒ (compose))
263   ("fqt" (set T ?ᇓ) ?ㅫ (compose))
264   ("fqg" (set T ?ᇔ) ?ᇔ (compose))
265   ("fqd" (set T ?ᇕ) ?ᇕ (compose))
266   ("ftt" (set T ?ᇖ) ?ᇖ (compose))
267   ("ft/" (set T ?ᇗ) ?ㅬ (compose))
268   ("fz" (set T ?ᇘ) ?ᇘ (compose))
269   ("fmd" (set T ?ᇙ) ?ㅭ (compose))
270   ("ar" (set T ?ᇚ) ?ᇚ (compose))
271   ("af" (set T ?ᇛ) ?ᇛ (compose))
272   ("at" (set T ?ᇝ) ?ㅯ (compose))
273   ("aT" (set T ?ᇞ) ?ᇞ (compose))
274   ("at/" (set T ?ᇟ) ?ㅰ (compose))
275   ("ac" (set T ?ᇠ) ?ᇠ (compose))
276   ("ag" (set T ?ᇡ) ?ᇡ (compose))
277   ("qf" (set T ?ᇣ) ?ᇣ (compose))
278   ("qg" (set T ?ᇥ) ?ᇥ (compose))
279   ("dR" (set T ?ᇭ) ?ᇭ (compose))
280   ("dt/" (set T ?ᇮ) ?ㆃ (compose))
281   ("dz" (set T ?ᇯ) ?ᇯ (compose))
282   ("gs" (set T ?ᇵ) ?ᇵ (compose))
283   ("gf" (set T ?ᇶ) ?ᇶ (compose))
284   ("ga" (set T ?ᇷ) ?ᇷ (compose))
285   ("gq" (set T ?ᇸ) ?ᇸ (compose)))
286
287  (special
288   ("J" (set V ?ᅠ) ?ᅠ (compose)))
289
290  (backspace
291   ((BackSpace) (cond ((> @@ 1) (undo)) (1 (unhandle))))))
292
293 (state
294  (init
295   ;; This is to suppress compose action.
296   (t (set L 0))
297   (L-or-T (set L L1) (set T 0x11A7) (shift state-L))
298   (L (set T 0x11A7) (shift state-L))
299   (V)
300   (T)
301   (special)
302   (backspace))
303  (state-L
304   (V (shift state-LV))
305   (backspace))
306  (state-LV
307   (L-or-T (shift state-LVL-or-LVT))
308   (T)
309   (backspace))
310  (state-LVL-or-LVT
311   (L-or-T-head (delete @<) (pushback 0) (set L 0) (shift state-fix-LVT))
312   (V-head (delete @<) (pushback 0) (set L 0) (shift state-fix-LV))
313   (backspace))
314  (state-fix-LVT
315   (L-or-T (set L L1) (set T 0x11A7) (shift state-fix-LVT-2))
316   (L (set T 0x11A7) (shift state-fix-LVT-2)))
317  (state-fix-LVT-2
318   (V (shift state-fix-LVT-3)))
319  (state-fix-LVT-3
320   (L-or-T (shift init)))
321  (state-fix-LV
322   (L-or-T (set L L1) (set T 0x11A7) (shift state-fix-LV-2))
323   (L (set T 0x11A7) (shift state-fix-LV-2)))
324  (state-fix-LV-2
325   (V (shift init))))
326
327 ;; Local Variables:
328 ;; coding: utf-8
329 ;; mode: lisp
330 ;; End: