Update copyright year to 2014 by running admin/update-copyright.
[bpt/emacs.git] / lisp / language / tibetan.el
CommitLineData
4b725a70 1;;; tibetan.el --- support for Tibetan language -*- coding: utf-8-emacs; -*-
80d75b56 2
ba318903 3;; Copyright (C) 1997, 2001-2014 Free Software Foundation, Inc.
38141d20 4;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
5df4f04c 5;; 2006, 2007, 2008, 2009, 2010, 2011
eaa61218
KH
6;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H14PRO021
8f924df7
KH
8;; Copyright (C) 2003
9;; National Institute of Advanced Industrial Science and Technology (AIST)
10;; Registration Number H13PRO009
80d75b56 11
eb2ffb18
GM
12;; Author: Toru TOMABECHI <Toru.Tomabechi@orient.unil.ch>
13;; Created: Feb. 17. 1997
8f924df7 14;; Keywords: multilingual, Tibetan, i18n
80d75b56
KH
15
16;; This file is part of GNU Emacs.
17
4936186e 18;; GNU Emacs is free software: you can redistribute it and/or modify
80d75b56 19;; it under the terms of the GNU General Public License as published by
4936186e
GM
20;; the Free Software Foundation, either version 3 of the License, or
21;; (at your option) any later version.
80d75b56
KH
22
23;; GNU Emacs is distributed in the hope that it will be useful,
24;; but WITHOUT ANY WARRANTY; without even the implied warranty of
25;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;; GNU General Public License for more details.
27
28;; You should have received a copy of the GNU General Public License
4936186e 29;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
80d75b56 30
eb2ffb18 31;;; History:
80d75b56 32
e4920bc9 33;; 1997.03.13 Modification for special signs and punctuation.
80d75b56 34
e8af40ee
PJ
35;;; Commentary:
36
80d75b56
KH
37;;; Code:
38
80d75b56
KH
39;;; Tibetan Character set.
40;;; \x2130 -- \x234a is a subset of Unicode v.2 \x0f00 - \x0fb9
41;;; with a slight modification. And there are some subjoined
42;;; consonants which are not specified in Unicode.
43;;; I hope I can add missing characters later.
44;;;
45;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
4b725a70
PE
46;;;2120 // ; obsolete glyphs (2123-5)
47;;;2130 ༀ ༁ ༂ ༃ ༄ ༅ ༆ ༇ ༈ ༉ ༊ ་ ༌ ། ༎ ༏ ; Punctuation,
48;;;2140 ༐ ༑ ༒ ༓ ༔ ༕ ༖ ༗ ༘ ༙ ༚ ༛ ༜ ༝ ༞ ༟ ; Digits and
49;;;2150 ༠ ༡ ༢ ༣ ༤ ༥ ༦ ༧ ༨ ༩ ༪ ༫ ༬ ༭ ༮ ༯ ; Special signs.
50;;;2160 ༰ ༱ ༲ ༳ ༴ ༵ ༶ ༷ ༸ ༹ ༺ ༻ ༼ ༽ ༾ ༿ ;
51;;;2170 // ;
80d75b56
KH
52;;;
53;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
4b725a70
PE
54;;;2220 // ཀ ཁ ག གྷ ང ཅ ཆ ཇ ཉ ཊ ཋ ཌ ཌྷ ཎ ; Base consonants
55;;;2230 ཏ ཐ ད དྷ ན པ ཕ བ བྷ མ ཙ ཚ ཛ ཛྷ ཝ ཞ ; and
56;;;2240 ཟ འ ཡ ར ལ ཤ ཥ ས ཧ ཨ ཀྵ ཪ ; Vowel signs.
57;;;2250 ཱ ི ཱི ུ ཱུ ྲྀ ཷ ླྀ ཹ ེ ཻ ོ ཽ ཾ ; (\x2251 = vowel a)
58;;;2260 ཿ ྀ ཱྀ ྂ ྃ ྄ ྅ ྆ ྇ ྈ ྉ ྊ ྋ ; Long vowels and
59;;;2270 // ; vocalic r, l ARE
ab3f4890 60;;; ; atomically
a1506d29 61;;; ; encoded.
80d75b56 62;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
4b725a70
PE
63;;;2320 // ྐ ྑ ྒ ྒྷ ྔ ྕ ྖ ྗ ྙ ྚ ྛ ྜ ྜྷ ྞ ; Subjoined consonants
64;;;2330 ྟ ྠ ྡ ྡྷ ྣ ྤ ྥ ྦ ྦྷ ྨ ྩ ྪ ྫ ྫྷ ྭ ྮ ;
65;;;2340 ྯ ྰ ྱ ྲ ླ ྴ ྵ ྶ ྷ ྸ ྐྵ ྺ ྻ ྼ ྾ ;
66;;;2350 ྿ ࿀ ࿁ ࿂ ࿃ ࿄ ࿅ ࿆ ࿇ ࿈ ࿉ ࿊ ࿋ ࿌ ; Hereafter, the chars
67;;;2360 ࿏ ; are not specified
68;;;2370 // ; in Unicode.
ab3f4890 69;;;
80d75b56 70;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
4b725a70
PE
71;;;2420 // ; Precomposed
72;;;2430 ; consonants for
73;;;2440 ; ordinary Tibetan.
74;;;2450 ; They are decomposed
75;;;2460 ; into base and
76;;;2470 // ; subjoined consonants
80d75b56
KH
77;;; ; when written on a
78;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ; file in Tibetan
4b725a70
PE
79;;;2520 // ; coding system.
80;;;2530 ;
81;;;2540 ;
82;;;2550 ;
83;;;2560 ;
84;;;2570 // ;
80d75b56
KH
85;;;
86
87
e1915ab3
KH
88(define-coding-system 'tibetan-iso-8bit
89 "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)."
90 :coding-type 'iso-2022
91 :mnemonic ?Q
92 :designation [ascii tibetan nil nil]
93 :charset-list '(ascii tibetan))
80d75b56 94
a79a3c79 95(define-coding-system-alias 'tibetan 'tibetan-iso-8bit)
80d75b56 96
80d75b56 97(set-language-info-alist
a564ccf9 98 "Tibetan" '((charset tibetan tibetan-1-column)
a79a3c79
KH
99 (coding-system tibetan-iso-8bit)
100 (coding-priority iso-2022-7bit tibetan-iso-8bit)
a564ccf9
KH
101 (input-method . "tibetan-wylie")
102 (features tibet-util)
80d75b56 103 (documentation . t)
4b725a70 104 (sample-text . "Tibetan (བོད་སྐད་) ༄༅༅༎བཀྲ་ཤིས་བདེ་ལེགས༎ཨོཾ་མ་ཎི་པདྨེ་ཧའུྂ༎")))
80d75b56 105
4b725a70 106;; `འ' is included in the pattern for subjoined consonants because we
d169c89e 107;; treat it specially in tibetan-add-components.
ab3f4890 108;; modified by Tomabechi 1999/12/10
3e799ba1
KH
109;; modified by Tomabechi 2000/06/08
110;; To allow infinite addition of vowels/modifiers
111;; as specified in Unicode v.3
4b725a70 112;; འ is removed from the class of subjoined. Tomabechi 2000/06/08
3e799ba1 113;; (for Unicode support)
d169c89e 114(defconst tibetan-composable-pattern
4b725a70 115 "[ཀ-ཀྵཪ][ྐ-ྐྵྺྻྼ]*[཰ཱི-྄ཱཽྀྀ]*[ཾྂྃ྆-ྋ༙༵༷]*"
d169c89e
KH
116 "Regexp matching a composable sequence of Tibetan characters.")
117
80d75b56
KH
118;;;
119;;; Definitions of conversion data.
120;;;
121
122
123;;; alists for tibetan char <-> transcription conversion
124;;; longer transcription should come first
125(defconst tibetan-consonant-transcription-alist
4b725a70
PE
126 '(("tsh" . "ཚ")
127 ("dzh" . "ཛྷ")
128 ("kSH" . "ཀྵ")
129 ("kh" . "ཁ")
130 ("gh" . "གྷ")
131 ("ng" . "ང")
132 ("ch" . "ཆ")
133 ("ny" . "ཉ")
134 ("TH" . "ཋ")
135 ("DH" . "ཌྷ")
136 ("th" . "ཐ")
137 ("dh" . "དྷ")
138 ("ph" . "ཕ")
139 ("bh" . "བྷ")
140 ("ts" . "ཙ")
141 ("dz" . "ཛ")
142 ("zh" . "ཞ")
143 ("sh" . "ཤ")
144 ("SH" . "ཥ")
145 ("k" . "ཀ")
146 ("g" . "ག")
147 ("c" . "ཅ")
148 ("j" . "ཇ")
149 ("T" . "ཊ")
150 ("D" . "ཌ")
151 ("N" . "ཎ")
152 ("t" . "ཏ")
153 ("d" . "ད")
154 ("n" . "ན")
155 ("p" . "པ")
156 ("b" . "བ")
157 ("m" . "མ")
158 ("w" . "ཝ")
159 ("z" . "ཟ")
160 ("'" . "འ")
161 ("y" . "ཡ")
162 ("r" . "ར")
163 ("l" . "ལ")
164 ("s" . "ས")
165 ("h" . "ཧ")
166 ("H" . "ཧ")
167 ("A" . "ཨ")
ab3f4890 168 ;; Added by Tomabechi 1999/12/10
4b725a70 169 ("R" . "ཪ") ;; fixed form RA
ab3f4890 170 ))
80d75b56
KH
171
172
173(defconst tibetan-vowel-transcription-alist
3e799ba1
KH
174 '(
175 ;; Composite Vowels
176 ;; Added by Tomabechi 2000/06/08
4b725a70
PE
177 ("frr" . "ཷ")
178 ("fll" . "ཹ")
179 ("fa" . "ཱ")
180 ("fi" . "ཱི")
181 ("fu" . "ཱུ")
182 ("fr" . "ྲྀ")
183 ("fl" . "ླྀ")
184 ("fI" . "ཱྀ")
3e799ba1 185 ;; Normal Vowels
4b725a70
PE
186 ("ai" . "ཻ")
187 ("au" . "ཽ")
188 ("ee" . "ཻ")
189 ("oo" . "ཽ")
190 ("a" . "") ; invisible vowel sign (\x2251)
191 ("i" . "ི")
192 ("u" . "ུ")
193 ("e" . "ེ")
194 ("o" . "ོ")
195 ("E" . "ཻ")
196 ("O" . "ཽ")
197 ("I" . "ྀ")
198 ("," . "྄") ; idem.
80d75b56
KH
199 ))
200
d169c89e 201(defconst tibetan-modifier-transcription-alist
4b725a70
PE
202 '(("M" . "ཾ")
203 ("~" . "ྂ")
204 ("`" . "ྃ")
205 ("x" . "ྈ")
206 ("X" . "ྉ")
207 ("v" . "྆")
208 ("V" . "྇")
209 ("q" . "ྊ")
210 ("Q" . "ྋ")
211 ("_/" . "༙")
212 ("_o" . "༷")
213 ("_O" . "༵")))
d169c89e 214
80d75b56 215(defconst tibetan-precomposed-transcription-alist
4b725a70
PE
216 '(("phyw" . "")
217 ("tshw" . "")
218 ("rtsw" . "")
219 ("khw" . "")
220 ("nyw" . "")
221 ("tsw" . "")
222 ("zhw" . "")
223 ("shw" . "")
224 ("khy" . "")
225 ("phy" . "")
226 ("khr" . "")
227 ("thr" . "")
228 ("phr" . "")
229 ("shr" . "")
230 ("dzr" . "")
231 ("grw" . "")
232 ("rng" . "")
233 ("rny" . "")
234 ("rts" . "")
235 ("rdz" . "")
236 ("rgw" . "")
237 ("rky" . "")
238 ("rgy" . "")
239 ("rmy" . "")
240 ("lng" . "")
241 ("sng" . "")
242 ("sny" . "")
243 ("sts" . "")
244 ("sky" . "")
245 ("sgy" . "")
246 ("spy" . "")
247 ("sby" . "")
248 ("smy" . "")
249 ("skr" . "")
250 ("sgr" . "")
251 ("snr" . "")
252 ("spr" . "")
253 ("sbr" . "")
254 ("smr" . "")
255 ("kw" . "")
256 ("gw" . "")
257 ("cw" . "")
258 ("tw" . "")
259 ("dw" . "")
260 ("zw" . "")
261 ("rw" . "")
262 ("lw" . "")
263 ("sw" . "")
264 ("hw" . "")
265 ("ky" . "")
266 ("gy" . "")
267 ("py" . "")
268 ("by" . "")
269 ("my" . "")
270 ("kr" . "")
271 ("gr" . "")
272 ("tr" . "")
273 ("dr" . "")
274 ("pr" . "")
275 ("brk" . "བ")
276 ("brg" . "བ")
277 ("brng" . "བ")
278 ("brj" . "བ")
279 ("brny" . "བ")
280 ("brt" . "བ")
281 ("brd" . "བ")
282 ("brn" . "བ")
283 ("brts" . "བ")
284 ("brdz" . "བ")
285 ("brl" . "བ")
286 ("br" . "")
287 ("mr" . "")
288 ("sr" . "")
289 ("hr" . "")
290 ("jr" . "")
291 ("kl" . "")
292 ("gl" . "")
293 ("blt" . "བ")
294 ("bld" . "བ")
295 ("bl" . "")
296 ("zl" . "")
297 ("rl" . "")
298 ("sl" . "")
299 ("rk" . "")
300 ("rg" . "")
301 ("rj" . "")
302 ("rt" . "")
303 ("rd" . "")
304 ("rn" . "")
305 ("rb" . "")
306 ("rm" . "")
307 ("lk" . "")
308 ("lg" . "")
309 ("lc" . "")
310 ("lj" . "")
311 ("lt" . "")
312 ("ld" . "")
313 ("ln" . "") ; dummy \x2121
314 ("lp" . "")
315 ("lb" . "")
316 ("lh" . "")
317 ("sk" . "")
318 ("sg" . "")
319 ("st" . "")
320 ("sd" . "")
321 ("sn" . "")
322 ("sp" . "")
323 ("sb" . "")
324 ("sm" . ""))
ab3f4890
KH
325 )
326
80d75b56
KH
327
328(defconst tibetan-subjoined-transcription-alist
4b725a70
PE
329 (sort '(("+k" . "ྐ")
330 ("+kh" . "ྑ")
331 ("+g" . "ྒ")
332 ("+gh" . "ྒྷ")
333 ("+ng" . "ྔ")
334 ("+c" . "ྕ")
335 ("+ch" . "ྖ")
336 ("+j" . "ྗ")
337 ("+ny" . "ྙ")
338 ("+T" . "ྚ")
339 ("+TH" . "ྛ")
340 ("+D" . "ྜ")
341 ("+DH" . "ྜྷ")
342 ("+N" . "ྞ")
343 ("+t" . "ྟ")
344 ("+th" . "ྠ")
345 ("+d" . "ྡ")
346 ("+dh" . "ྡྷ")
347 ("+n" . "ྣ")
348 ("+p" . "ྤ")
349 ("+ph" . "ྥ")
350 ("+b" . "ྦ")
351 ("+bh" . "ྦྷ")
352 ("+m" . "ྨ")
353 ("+ts" . "ྩ")
354 ("+tsh" . "ྪ")
355 ("+dz" . "ྫ")
356 ("+dzh" . "ྫྷ")
357 ("+w" . "ྭ")
358 ("+zh" . "ྮ")
359 ("+z" . "ྯ")
360 ("+'" . "ྰ")
361 ("+y" . "ྱ")
362 ("+r" . "ྲ")
363 ("+l" . "ླ")
364 ("+sh" . "ྴ")
365 ("+SH" . "ྵ")
366 ("+s" . "ྶ")
367 ("+h" . "ྷ")
368 ("+A" . "ྸ")
369 ("+kSH" . "ྐྵ")
ab3f4890 370 ;; Added by Tomabechi 1999/12/10
4b725a70
PE
371 ("+W" . "ྺ") ;; fixed form subscribed WA
372 ("+Y" . "ྻ") ;; fixed form subscribed YA
373 ("+R" . "ྼ") ;; fixed form subscribed RA
ab3f4890 374 )
d169c89e 375 (lambda (x y) (> (length (car x)) (length (car y))))))
80d75b56
KH
376
377;;;
378;;; alist for Tibetan base consonant <-> subjoined consonant conversion.
379;;;
380(defconst tibetan-base-to-subjoined-alist
4b725a70
PE
381 '(("ཀ" . "ྐ")
382 ("ཁ" . "ྑ")
383 ("ག" . "ྒ")
384 ("གྷ" . "ྒྷ")
385 ("ང" . "ྔ")
386 ("ཅ" . "ྕ")
387 ("ཆ" . "ྖ")
388 ("ཇ" . "ྗ")
389 ("ཉ" . "ྙ")
390 ("ཊ" . "ྚ")
391 ("ཋ" . "ྛ")
392 ("ཌ" . "ྜ")
393 ("ཌྷ" . "ྜྷ")
394 ("ཎ" . "ྞ")
395 ("ཏ" . "ྟ")
396 ("ཐ" . "ྠ")
397 ("ད" . "ྡ")
398 ("དྷ" . "ྡྷ")
399 ("ན" . "ྣ")
400 ("པ" . "ྤ")
401 ("ཕ" . "ྥ")
402 ("བ" . "ྦ")
403 ("བྷ" . "ྦྷ")
404 ("མ" . "ྨ")
405 ("ཙ" . "ྩ")
406 ("ཚ" . "ྪ")
407 ("ཛ" . "ྫ")
408 ("ཛྷ" . "ྫྷ")
409 ("ཝ" . "ྭ")
410 ("ཞ" . "ྮ")
411 ("ཟ" . "ྯ")
412 ("འ" . "ྰ")
413 ("ཡ" . "ྱ")
414 ("ར" . "ྲ")
415 ("ལ" . "ླ")
416 ("ཤ" . "ྴ")
417 ("ཥ" . "ྵ")
418 ("ས" . "ྶ")
419 ("ཧ" . "ྷ")
420 ("ཨ" . "ྸ")
421 ("ཀྵ" . "ྐྵ")
ab3f4890 422 ;; Added by Tomabechi 1999/12/10
4b725a70 423 ("ཪ" . "ྼ") ;; Fixed form RA (224B->234D)
ab3f4890 424 ))
3e799ba1
KH
425
426;;; alist for Tibetan composite vowels (long i, vocalic r, etc.)
ee7683eb 427;;; New variable. created by Tomabechi 2000/06/08
3e799ba1
KH
428(defconst tibetan-composite-vowel-alist
429 '(;; LONG A
4b725a70 430 ;; ("ཱ" . ((bc . tc) ?ཱ))
3e799ba1 431 ;; LONG I
4b725a70 432 ("ཱི" . (?ཱ (tc . bc) ?ི))
3e799ba1 433 ;; LONG U
4b725a70 434 ("ཱུ" . (?ཱ (bc . tc) ?ུ))
3e799ba1 435 ;; VOCALIC R
4b725a70 436 ("ྲྀ" . (?ྲ (tc . bc) ?ྀ))
3e799ba1 437 ;; LONG VOCALIC R
4b725a70 438 ("ཷ" . (?ྲ (bc . tc) ?ཱ (tc . bc) ?ྀ))
3e799ba1 439 ;; VOCALIC L
4b725a70
PE
440 ("ླྀ" . (?ླ (tc . bc) ?ྀ))
441 ;;་LONG VOCALIC L
442 ("ཹ" . (?ླ (bc . tc) ?ཱ (tc . bc) ?ྀ))
3e799ba1 443 ;; LONG REVERSE I
4b725a70 444 ("ཱྀ" . (?ཱ (tc . bc) ?ྀ))
3e799ba1
KH
445 ))
446
447
448
80d75b56
KH
449;;;
450;;; alist for Tibetan consonantic components <-> precomposed glyph conversion.
451;;; (includes some punctuation conversion rules)
452;;;
453(defconst tibetan-precomposition-rule-alist
4b725a70
PE
454 `(("ཕྱྭ" . "")
455 ("གྲྭ" . "")
456 ("ཚྭ" . "")
457 ("རྩྭ" . "")
458 ("རྒྭ" . "")
459 ("རྐྱ" . "")
460 ("རྒྱ" . "")
461 ("རྨྱ" . "")
462 ("སྐྱ" . "")
463 ("སྒྱ" . "")
464 ("སྤྱ" . "")
465 ("སྦྱ" . "")
466 ("སྨྱ" . "")
467 ("སྐྲ" . "")
468 ("སྒྲ" . "")
469 ("སྣྲ" . "")
470 ("སྤྲ" . "")
471 ("སྦྲ" . "")
472 ("སྨྲ" . "")
473 ("ཁྭ" . "")
474 ("ཉྭ" . "")
475 ("ཙྭ" . "")
476 ("ཞྭ" . "")
477 ("ཤྭ" . "")
478 ("ཁྱ" . "")
479 ("ཕྱ" . "")
480 ("ཁྲ" . "")
481 ("ཐྲ" . "")
482 ("ཕྲ" . "")
483 ("ཤྲ" . "")
484 ("ཛྲ" . "")
485 ("རྔ" . "")
486 ("རྙ" . "")
487 ("རྩ" . "")
488 ("རྫ" . "")
489 ("ལྔ" . "")
490 ("སྔ" . "")
491 ("སྙ" . "")
492 ("སྩ" . "")
493 ("ཀྭ" . "")
494 ("གྭ" . "")
495 ("ཅྭ" . "")
496 ("ཏྭ" . "")
497 ("དྭ" . "")
498 ("ཟྭ" . "")
499 ("རྭ" . "")
500 ("ལྭ" . "")
501 ("སྭ" . "")
502 ("ཧྭ" . "")
503 ("ཀྱ" . "")
504 ("གྱ" . "")
505 ("པྱ" . "")
506 ("བྱ" . "")
507 ("མྱ" . "")
508 ("ཀྲ" . "")
509 ("གྲ" . "")
510 ("ཏྲ" . "")
511 ("དྲ" . "")
512 ("པྲ" . "")
513 ("བྲ" . "")
514 ("མྲ" . "")
515 ("སྲ" . "")
516 ("ཧྲ" . "")
517 ("ཇྲ" . "")
518 ("ཀླ" . "")
519 ("གླ" . "")
520 ("བླ" . "")
521 ("ཟླ" . "")
522 ("རླ" . "")
523 ("སླ" . "")
524 ("རྐ" . "")
525 ("རྒ" . "")
526 ("རྗ" . "")
527 ("རྟ" . "")
528 ("རྡ" . "")
529 ("རྣ" . "")
530 ("རྦ" . "")
531 ("རྨ" . "")
532 ("ལྐ" . "")
533 ("ལྒ" . "")
534 ("ལྣ" . "") ; dummy 0x2121 added 2000/06/08 for transition l -> lng
535 ("ལྕ" . "")
536 ("ལྗ" . "")
537 ("ལྟ" . "")
538 ("ལྡ" . "")
539 ("ལྤ" . "")
540 ("ལྦ" . "")
541 ("ལྷ" . "")
542 ("སྐ" . "")
543 ("སྒ" . "")
544 ("སྟ" . "")
545 ("སྡ" . "")
546 ("སྣ" . "")
547 ("སྤ" . "")
548 ("སྦ" . "")
549 ("སྨ" . "")))
d169c89e 550
d169c89e
KH
551(defconst tibetan-regexp
552 (let ((l (list tibetan-precomposed-transcription-alist
553 tibetan-consonant-transcription-alist
554 tibetan-vowel-transcription-alist
555 tibetan-modifier-transcription-alist
556 tibetan-subjoined-transcription-alist))
557 (separator "\\|")
558 tail pattern)
80d75b56 559 (while l
d169c89e
KH
560 (setq tail (car l) l (cdr l))
561 (while tail
562 (setq pattern (cons separator (cons (car (car tail)) pattern))
563 tail (cdr tail))))
564 (apply 'concat (nreverse (cdr pattern))))
565 "Regexp matching a Tibetan transcription of a composable Tibetan sequence.
566The result of matching is to be used for indexing alists at conversion
567from a roman transcription to the corresponding Tibetan character.")
80d75b56
KH
568
569(defvar tibetan-precomposed-regexp
ca0a881a 570 (purecopy
80d75b56
KH
571 (let ((l tibetan-precomposed-transcription-alist)
572 temp)
573 (setq temp "^\\(")
574 (setq temp
575 (concat temp (car (car l))))
576 (setq l (cdr l))
577 (while l
578 (setq temp
579 (concat temp "\\|" (car (car l))))
580 (setq l (cdr l)))
ca0a881a 581 (concat temp "\\)")))
80d75b56
KH
582 "Regexp string to match a romanized Tibetan complex consonant.
583The result of matching is to be used for indexing alists when the input key
584from an input method is converted to the corresponding precomposed glyph.")
585
586(defvar tibetan-precomposition-rule-regexp
ca0a881a 587 (purecopy
80d75b56
KH
588 (let ((l tibetan-precomposition-rule-alist)
589 temp)
590 (setq temp "\\(")
591 (setq temp (concat temp (car (car l))))
592 (setq l (cdr l))
593 (while l
594 (setq temp (concat temp "\\|" (car (car l))))
595 (setq l (cdr l)))
ca0a881a 596 (concat temp "\\)")))
80d75b56
KH
597 "Regexp string to match a sequence of Tibetan consonantic components, i.e.,
598one base consonant and one or more subjoined consonants.
599The result of matching is to be used for indexing alist when the component
600sequence is converted to the corresponding precomposed glyph.
601This also matches some punctuation characters which need conversion.")
602
603(defvar tibetan-decomposed nil)
604(defvar tibetan-decomposed-temp nil)
605
69d21b0c 606;; For automatic composition.
ee7683eb 607(set-char-table-range
d5165952
KH
608 composition-function-table '(#xF00 . #xFD1)
609 (list (vector tibetan-composable-pattern 0 'font-shape-gstring)))
69d21b0c 610
41da80b1
DL
611(provide 'tibetan)
612
e8af40ee 613;;; tibetan.el ends here