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.thlib.org/reference/transliteration/#essay=/thl/ewts>.")
34 (_"Flag to tell whether or not to generate precomposed characters.
35 If 1, generate precomposed characters if available (e.g. \"ྲྀ\"(U+0F76).
36 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) "\\"))
285 ("u" "u" (set MAX-COUNT 4))
286 ("U" "U" (set MAX-COUNT 8)))
310 ((Backspace) (undo))))
314 (consonant (shift after-consonant))
315 (standard-stack (shift after-consonant))
316 (sanskrit (shift after-consonant))
317 (vowel (move @<) "ཨ" (move @>) (shift after-vowel))
319 (escape (shift dispatch-escape))
320 (non-tibetan (shift non-tibetan))
324 (force-stack (shift consonant-stack))
325 (break-stack (shift init))
326 (vowel (shift after-vowel)))
330 (special-subjoined (shift after-consonant))
331 (consonant (set C @-1) (delete @-1) (add C #x50) (insert C)
332 (shift after-consonant))
337 (force-stack (shift vowel-stack)))
341 (vowel (shift after-vowel)))
344 (unicode (shift unicode))
345 (nil (delete BEG) (shift init) (unhandle)))
349 (t (set COUNT 0) (set UNICODE 0))
350 (hexadigit (cond ((> @-1 ?9) (set UNICODE (+ (* UNICODE 16) (- @-1 55))))
351 (1 (set UNICODE (+ (* UNICODE 16) (- @-1 48)))))
352 (set COUNT (+ COUNT 1))
353 (cond ((= COUNT MAX-COUNT) (delete BEG) (insert UNICODE)
358 (unescape (shift init))