1 ;; bo-ewts.mim -- Tibetan input method with EWTS
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 bo ewts)
26 (description "Tibetan input method based on EWTS.
27 This implementation is based on THDL Extended Wylie Transliteration Scheme
28 Version 2.0 <http://www.thdl.org/collections/langling/ewts/ewts.php>.")
32 (_"Flag to tell whether or not to generate precomposed characters.
33 If 1, generate precomposed characters if available (e.g. \"ྲྀ\"(U+0F76).
34 If 0, generate only decomposed characters (e.g. \"ྲྀ\" (U+0FB2 U+0F80).")
40 ;; This map is used also for subjoined consonants.
73 ;; Standard Tibetan Stacks listed at:
74 ;; <http://www.thdl.org/collections/langling/tibstacks.html>
176 ("oM" (cond (precomposed "ༀ") (1 "ཨོཾ")))
186 ("h" (cond ((= precomposed 0) "ྷ")
187 ((= @-1 ?ག) (delete @-1) "གྷ")
188 ((= @-1 ?ད) (delete @-1) "དྷ")
189 ((= @-1 ?བ) (delete @-1) "བྷ")
190 ((= @-1 ?ཛ) (delete @-1) "ཛྷ")
192 ("Sh" (cond ((= precomposed 0) "ྵ")
193 ((= @-1 ?ཀ) (delete @-1) "ཀྵ")
205 ("-i" (cond ((= precomposed 0) "ྀ")
216 ("-I" (cond ((= precomposed 0) "ཱྀ")
233 ;; These half numbers are not in EWTS but for convenience.
244 ;; Sanskrit-related marks
251 ;; Intersyllabic marks
254 ;; Phrase deliminating marks
268 ;; Paired punctuation marks (brackets)
279 ("\\" (mark @BEG) "\\" (shift dispatch-escape))
280 ("[" (shift non-tibetan)))
283 ("u" "u" (set MAX-COUNT 4) (shift unicode))
284 ("U" "U" (set MAX-COUNT 8) (shift unicode)))
308 ((Backspace) (undo))))
312 (consonant (shift after-consonant))
313 (standard-stack (shift after-consonant))
314 (sanskrit (shift after-consonant))
315 (vowel (move @<) "ཨ" (move @>) (shift after-vowel))
321 (force-stack (shift consonant-stack))
322 (break-stack (shift init))
323 (vowel (shift after-vowel)))
327 (special-subjoined (shift after-consonant))
328 (consonant (set C @-1) (delete @-1) (add C #x50) (insert C)
329 (shift after-consonant))
334 (force-stack (shift vowel-stack)))
338 (vowel (shift after-vowel)))
342 (nil (delete @BEG) (shift init) (unhandle)))
346 (t (set COUNT 0) (set UNICODE 0))
347 (hexadigit (cond ((> @-1 ?9) (set UNICODE (+ (* UNICODE 16) (- @-1 55))))
348 (1 (set UNICODE (+ (* UNICODE 16) (- @-1 48)))))
349 (set COUNT (+ COUNT 1))
350 (cond ((= COUNT MAX-COUNT) (delete @BEG) (insert UNICODE)
355 (unescape (shift init))