1 ;; bo-ewts.mim -- Tibetan input method with EWTS
2 ;; Copyright (C) 2007, 2008, 2009
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
5 ;; Copyright (C) 2010 Hugues MOISY <hugues.moisy@gmail.com>
7 ;; This file is part of the m17n database; a sub-part of the m17n
10 ;; The m17n library is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU Lesser General Public License
12 ;; as published by the Free Software Foundation; either version 2.1 of
13 ;; the License, or (at your option) any later version.
15 ;; The m17n library is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; Lesser General Public License for more details.
20 ;; You should have received a copy of the GNU Lesser General Public
21 ;; License along with the m17n library; if not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
25 (input-method bo ewts)
27 (description "Tibetan input method based on EWTS.
28 This implementation is based on THDL Extended Wylie Transliteration Scheme
29 Version 2.0 <http://www.thdl.org/collections/langling/ewts/ewts.php>.")
35 (_"Flag to tell whether or not to generate precomposed characters.
36 If 1, generate precomposed characters if available (e.g. \"ྲྀ\"(U+0F76).
37 If 0, generate only decomposed characters (e.g. \"ྲྀ\" (U+0FB2 U+0F80).")
41 ;; This map is used also for subjoined consonants.
86 ;; Standard Tibetan Stacks listed at:
87 ;; <http://www.thdl.org/collections/langling/tibstacks.html>
201 ("oM" (cond (precomposed "ༀ") (1 "ཨོཾ")))
211 ("h" (cond ((= precomposed 0) "ྷ")
212 ((= @-1 ?ག) (delete @-1) "གྷ")
213 ((= @-1 ?ད) (delete @-1) "དྷ")
214 ((= @-1 ?བ) (delete @-1) "བྷ")
215 ((= @-1 ?ཛ) (delete @-1) "ཛྷ")
217 ("Sh" (cond ((= precomposed 0) "ྵ")
218 ((= @-1 ?ཀ) (delete @-1) "ཀྵ")
231 ("-i" (cond ((= precomposed 0) "ྀ")
245 ("-I" (cond ((= precomposed 0) "ཱྀ")
262 ;; These half numbers are not in EWTS but for convenience.
273 ;; Sanskrit-related marks
280 ;; Intersyllabic marks
283 ;; Phrase deliminating marks
297 ;; Paired punctuation marks (brackets)
308 ("\\" (mark BEG) "\\"))
314 ("u" "u" (set MAX-COUNT 4))
315 ("U" "U" (set MAX-COUNT 8)))
339 ((Backspace) (undo))))
343 (consonant (shift after-consonant))
344 (standard-stack (shift after-consonant))
345 (sanskrit (shift after-consonant))
346 (vowel (move @<) "ཨ" (move @>) (shift after-vowel))
348 (escape (shift dispatch-escape))
349 (non-tibetan (shift non-tibetan))
353 (force-stack (shift consonant-stack))
354 (break-stack (shift init))
355 (vowel (shift after-vowel)))
359 (special-subjoined (shift after-consonant))
360 (consonant (set C @-1) (delete @-1) (add C #x50) (insert C)
361 (shift after-consonant))
366 (force-stack (shift vowel-stack)))
370 (vowel (shift after-vowel)))
373 (unicode (shift unicode))
374 (nil (delete BEG) (shift init) (unhandle)))
378 (t (set COUNT 0) (set UNICODE 0))
379 (hexadigit (cond ((> @-1 ?9) (set UNICODE (+ (* UNICODE 16) (- @-1 55))))
380 (1 (set UNICODE (+ (* UNICODE 16) (- @-1 48)))))
381 (set COUNT (+ COUNT 1))
382 (cond ((= COUNT MAX-COUNT) (delete BEG) (insert UNICODE)
387 (unescape (shift init))