1 ;; cmc-kdb.mim -- Cham input method based on Cham keyboard
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., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
24 (input-method cmc kbd)
26 (description "Cham input method simulating Cham keyboard.")
31 ;; Independent vowels and consonants
139 ;; Traditional punctuations.
153 (cond ((& (>= PREV 0xAA00) (<= PREV 0xAA28))
154 (delete @-2) (insert PM))
156 ((| (= PREV PV1) (= PREV PV2))
158 (cond ((& (>= @-3 0xAA00) (<= @-3 0xAA28))
160 (insert PREV) (insert PM))
162 ((& (>= @-2 0xAA00) (<= @-2 0xAA28))
170 (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
174 (cond ((| (= N3 PV1) (= N3 PV2))
175 (delete @+3) (insert NEXT) (insert N2))
176 (1 (delete @+2) (insert NEXT))))
177 ((| (= N2 PV1) (= N2 PV2))
178 (delete @+2) (insert NEXT))
185 (t (set PM 0xAA34) ; PRE-MEDIAL
186 (set PV1 0xAA2F) ; PRE-VOWEL-1
187 (set PV2 0xAA30) ; PRE-VOWEL-2
191 (set C @-) (set PREV @-2)
194 (cond ((| (= PREV PV1) (= PREV PV2))
195 (delete @-3) (insert C) (insert PM) (insert PREV))
196 ((| (< PREV 0xAA00) (> PREV 0xAA28))
197 (delete @-2) (insert C) (insert PM))))
198 ((| (= PREV PV1) (= PREV PV2))
200 ((| (< @-3 0xAA00) (> @-3 0xAA28))
201 (delete @-2) (insert C) (insert PREV))))))
204 (set C @-) (set NEXT @+1)
205 (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
206 (delete @-1) (delete @+1) (insert NEXT) (insert C) (set NEXT @+1)))
207 (cond ((& (>= NEXT 0xAA33) (<= NEXT 0xAA36))
208 (delete @-1) (delete @+1) (insert NEXT) (insert C))))
211 (set C @-) (set NEXT @+1)
212 (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
213 (delete @-1) (delete @+1) (insert NEXT) (insert C))))