1 ;; ko-romaja.mim -- Input method for Korean Hangul with Romaja keys.
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA
24 ;;; <li> ko-romaja.mim
26 ;;; Input method for Korean Hangul using Romaja keys. The
27 ;;; roman-transliteration rules follows that of IIIMF shown in this
28 ;;; page: http://www3.sympatico.ca/d.moser/hangul.html
34 ;; Convert Jamo sequence LVT to a precomposed character.
35 ;; See the Unicode Standard Version 3.0, Section 3.11.
37 ((set LIndex L) (sub LIndex 0x1100)
38 (set VIndex V) (sub VIndex 0x1161)
39 (set TIndex T) (sub TIndex 0x11A7)
40 ;; S = (LIndex * VCount + Vindex) * TCount + TIndex + SBase
46 (add S 0xAC00) ;; SBase
50 ;; If L is not negatice, convert Jame sequence LV to a precomposed
51 ;; character while assuming T is 0x11A7. If L is 0 (i.e. missing),
56 ((= L 0 ((set L 0x110B)))
63 ;; Common keys for CHOSEONG and JONGSEONG.
64 ;; Set L1 to CHOSEONG, T to JONGSEONG, insert a Compatibility Jamo.
66 ("g" (set L1 0x1100) (set T 0x11A8) ?ㄱ (compose))
67 ("gg" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
68 ("G" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
69 ("n" (set L1 0x1102) (set T 0x11AB) ?ㄲ (compose))
70 ("d" (set L1 0x1103) (set T 0x11AE) ?ㄷ (compose))
71 ("m" (set L1 0x1106) (set T 0x11B7) ?ㅁ (compose))
72 ("b" (set L1 0x1107) (set T 0x11B8) ?ㅂ (compose))
73 ("s" (set L1 0x1109) (set T 0x11BA) ?ㅅ (compose))
74 ("ss" (set L1 0x110A) (set T 0x11BB) ?ㅆ (compose))
75 ("j" (set L1 0x110C) (set T 0x11BD) ?ㅈ (compose))
76 ("z" (set L1 0x110C) (set T 0x11BD) ?ㅈ (compose))
77 ("ch" (set L1 0x110E) (set T 0x11BE) ?ㅊ (compose))
78 ("k" (set L1 0x110F) (set T 0x11BF) ?ㅋ (compose))
79 ("t" (set L1 0x1110) (set T 0x11C0) ?ㅌ (compose))
80 ("p" (set L1 0x1111) (set T 0x11C1) ?ㅍ (compose))
81 ("h" (set L1 0x1112) (set T 0x11C2) ?ㅎ (compose)))
85 ("g") ("G") ("n") ("d") ("m") ("b") ("s") ("j") ("z") ("c")
86 ("k") ("t") ("p") ("h"))
88 ;; Keys only for CHOSEONG.
89 ;; Set L to CHOSEONG, insert a Compatibility Jamo.
91 ("dd" (set L 0x1104) ?ㄸ)
92 ("D" (set L 0x1104) ?ㄸ)
93 ("r" (set L 0x1105) ?ㄹ)
94 ("bb" (set L 0x1108) ?ㅃ)
95 ("B" (set L 0x1108) ?ㅃ)
96 ("S" (set L 0x110A) ?ㅆ)
97 ("jj" (set L 0x110D) ?ㅉ)
98 ("J" (set L 0x110D) ?ㅉ)
99 ("zz" (set L 0x110D) ?ㅉ)
100 ("Z" (set L 0x110D) ?ㅉ)
101 ("q" (set L 0x110F) ?ㅋ))
103 ;; Keys only for JONGSEONG.
104 ;; Set T to JONGSEONG, insert a Compatibility Jamo.
106 ("gs" (set T 0x11AA) ?ㄳ (compose))
107 ("nj" (set T 0x11AC) ?ㄵ (compose))
108 ("nh" (set T 0x11AD) ?ㄶ (compose))
109 ("l" (set T 0x11AF) ?ㄹ (compose))
110 ("lg" (set T 0x11B0) ?ㄺ (compose))
111 ("lm" (set T 0x11B1) ?ㄻ (compose))
112 ("lb" (set T 0x11B2) ?ㄼ (compose))
113 ("ls" (set T 0x11B3) ?ㄽ (compose))
114 ("lt" (set T 0x11B4) ?ㄾ (compose))
115 ("lp" (set T 0x11B5) ?ㄿ (compose))
116 ("lh" (set T 0x11B6) ?ㅀ (compose))
117 ("bs" (set T 0x11B9) ?ㅄ (compose))
118 ("ng" (set T 0x11BC) ?ㅇ (compose)))
120 ;; Keys only for JUNGSEONG.
121 ;; Set V to JUNGSEONG, insert a Compatibility Jamo.
123 ("a" (set V 0x1161) ?ㅏ (compose-vowel))
124 ("ai" (set V 0x1162) ?ㅐ (compose-vowel))
125 ("ae" (set V 0x1162) ?ㅐ (compose-vowel))
126 ("ya" (set V 0x1163) ?ㅑ (compose-vowel))
127 ("yai" (set V 0x1164) ?ㅒ (compose-vowel))
128 ("yae" (set V 0x1164) ?ㅒ (compose-vowel))
129 ("eo" (set V 0x1165) ?ㅓ (compose-vowel))
130 ("e" (set V 0x1166) ?ㅔ (compose-vowel))
131 ("eoi" (set V 0x1166) ?ㅔ (compose-vowel))
132 ("yeo" (set V 0x1167) ?ㅕ (compose-vowel))
133 ("ye" (set V 0x1168) ?ㅖ (compose-vowel))
134 ("yeoi"(set V 0x1168) ?ㅖ (compose-vowel))
135 ("o" (set V 0x1169) ?ㅗ (compose-vowel))
136 ("oa" (set V 0x116A) ?ㅘ (compose-vowel))
137 ("wa" (set V 0x116A) ?ㅘ (compose-vowel))
138 ("oai" (set V 0x116B) ?ㅙ (compose-vowel))
139 ("wae" (set V 0x116B) ?ㅙ (compose-vowel))
140 ("oi" (set V 0x116C) ?ㅚ (compose-vowel))
141 ("oe" (set V 0x116C) ?ㅚ (compose-vowel))
142 ("yo" (set V 0x116D) ?ㅛ (compose-vowel))
143 ("u" (set V 0x116E) ?ㅜ (compose-vowel))
144 ("ueo" (set V 0x116F) ?ㅝ (compose-vowel))
145 ("wo" (set V 0x116F) ?ㅝ (compose-vowel))
146 ("ue" (set V 0x1170) ?ㅞ (compose-vowel))
147 ("we" (set V 0x1170) ?ㅞ (compose-vowel))
148 ("ui" (set V 0x1171) ?ㅟ (compose-vowel))
149 ("wi" (set V 0x1171) ?ㅟ (compose-vowel))
150 ("yu" (set V 0x1172) ?ㅠ (compose-vowel))
151 ("eu" (set V 0x1173) ?ㅡ (compose-vowel))
152 ("eui" (set V 0x1174) ?ㅢ (compose-vowel))
153 ("ui" (set V 0x1174) ?ㅢ (compose-vowel))
154 ("i" (set V 0x1175) ?ㅣ (compose-vowel)))
158 ("a") ("y") ("e") ("o") ("w") ("u") ("i"))
171 ((BackSpace) (undo)))
182 (X (set L L1) (shift after-L))
188 (tilda (shift single)))
195 (X (shift after-LVX))
200 (V-head (delete @<) (pushback 0) (shift fix-LV-redo-L))
203 (nil (delete @<) (pushback 0) (shift fix-LVT-redo-L)))
207 (X (set L L1) (shift fix-LVT-redo-V))
208 (L (shift fix-LVT-redo-V))
209 (V (shift fix-LVT-redo-T)))
211 (V (shift fix-LVT-redo-T)))
217 (X (set L L1) (shift fix-LV-redo-V))
218 (L (shift fix-LV-redo-V))