Update FSF's address.
[bpt/emacs.git] / lisp / language / tibetan.el
1 ;;; tibetan.el --- support for Tibetan language -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1997, 2002 Free Software Foundation, Inc.
4 ;; Copyright (C) 1997, 1999, 2000
5 ;; National Institute of Advanced Industrial Science and Technology (AIST)
6 ;; Registration Number H14PRO021
7
8 ;; Keywords: multilingual, Tibetan
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
26
27 ;; Author: Toru TOMABECHI, <Toru.Tomabechi@orient.unil.ch>
28
29 ;; Created: Feb. 17. 1997
30
31 ;; History:
32 ;; 1997.03.13 Modification for special signs and punctuations.
33
34 ;;; Commentary:
35
36 ;;; Code:
37
38 ;;; Tibetan Character set.
39 ;;; \x2130 -- \x234a is a subset of Unicode v.2 \x0f00 - \x0fb9
40 ;;; with a slight modification. And there are some subjoined
41 ;;; consonants which are not specified in Unicode.
42 ;;; I hope I can add missing characters later.
43 ;;;
44 ;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
45 ;;;2120 // \e$(7!!\e(B \e$(7!"\e(B \e$(7!#\e(B \e$(7!$\e(B \e$(7!%\e(B \e$(7!&\e(B \e$(7!'\e(B \e$(7!(\e(B \e$(7!)\e(B \e$(7!*\e(B \e$(7!+\e(B \e$(7!,\e(B \e$(7!-\e(B \e$(7!.\e(B \e$(7!/\e(B ; obsolete glyphs (2123-5)
46 ;;;2130 \e$(7!0\e(B \e$(7!1\e(B \e$(7!2\e(B \e$(7!3\e(B \e$(7!4\e(B \e$(7!5\e(B \e$(7!6\e(B \e$(7!7\e(B \e$(7!8\e(B \e$(7!9\e(B \e$(7!:\e(B \e$(7!;\e(B \e$(7!<\e(B \e$(7!=\e(B \e$(7!>\e(B \e$(7!?\e(B ; Punctuations,
47 ;;;2140 \e$(7!@\e(B \e$(7!A\e(B \e$(7!B\e(B \e$(7!C\e(B \e$(7!D\e(B \e$(7!E\e(B \e$(7!F\e(B \e$(7!G\e(B \e$(7!H\e(B \e$(7!I\e(B \e$(7!J\e(B \e$(7!K\e(B \e$(7!L\e(B \e$(7!M\e(B \e$(7!N\e(B \e$(7!O\e(B ; Digits and
48 ;;;2150 \e$(7!P\e(B \e$(7!Q\e(B \e$(7!R\e(B \e$(7!S\e(B \e$(7!T\e(B \e$(7!U\e(B \e$(7!V\e(B \e$(7!W\e(B \e$(7!X\e(B \e$(7!Y\e(B \e$(7!Z\e(B \e$(7![\e(B \e$(7!\\e(B \e$(7!]\e(B \e$(7!^\e(B \e$(7!_\e(B ; Special signs.
49 ;;;2160 \e$(7!`\e(B \e$(7!a\e(B \e$(7!b\e(B \e$(7!c\e(B \e$(7!d\e(B \e$(7!e\e(B \e$(7!f\e(B \e$(7!g\e(B \e$(7!h\e(B \e$(7!i\e(B \e$(7!j\e(B \e$(7!k\e(B \e$(7!l\e(B \e$(7!m\e(B \e$(7!n\e(B \e$(7!o\e(B ;
50 ;;;2170 \e$(7!p\e(B \e$(7!q\e(B \e$(7!r\e(B \e$(7!s\e(B \e$(7!t\e(B \e$(7!u\e(B \e$(7!v\e(B \e$(7!w\e(B \e$(7!x\e(B \e$(7!y\e(B \e$(7!z\e(B \e$(7!{\e(B \e$(7!|\e(B \e$(7!}\e(B \e$(7!~\e(B // ;
51 ;;;
52 ;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
53 ;;;2220 // \e$(7"!\e(B \e$(7""\e(B \e$(7"#\e(B \e$(7"$\e(B \e$(7"%\e(B \e$(7"&\e(B \e$(7"'\e(B \e$(7"(\e(B \e$(7")\e(B \e$(7"*\e(B \e$(7"+\e(B \e$(7",\e(B \e$(7"-\e(B \e$(7".\e(B \e$(7"/\e(B ; Base consonants
54 ;;;2230 \e$(7"0\e(B \e$(7"1\e(B \e$(7"2\e(B \e$(7"3\e(B \e$(7"4\e(B \e$(7"5\e(B \e$(7"6\e(B \e$(7"7\e(B \e$(7"8\e(B \e$(7"9\e(B \e$(7":\e(B \e$(7";\e(B \e$(7"<\e(B \e$(7"=\e(B \e$(7">\e(B \e$(7"?\e(B ; and
55 ;;;2240 \e$(7"@\e(B \e$(7"A\e(B \e$(7"B\e(B \e$(7"C\e(B \e$(7"D\e(B \e$(7"E\e(B \e$(7"F\e(B \e$(7"G\e(B \e$(7"H\e(B \e$(7"I\e(B \e$(7"J\e(B \e$(7"K\e(B \e$(7"L\e(B \e$(7"M\e(B \e$(7"N\e(B \e$(7"O\e(B ; Vowel signs.
56 ;;;2250 \e$(7"P\e(B \e$(7"Q\e(B \e$(7"R\e(B \e$(7"S\e(B \e$(7"T\e(B \e$(7"U\e(B \e$(7"V\e(B \e$(7"W\e(B \e$(7"X\e(B \e$(7"Y\e(B \e$(7"Z\e(B \e$(7"[\e(B \e$(7"\\e(B \e$(7"]\e(B \e$(7"^\e(B \e$(7"_\e(B ; (\x2251 = vowel a)
57 ;;;2260 \e$(7"`\e(B \e$(7"a\e(B \e$(7"b\e(B \e$(7"c\e(B \e$(7"d\e(B \e$(7"e\e(B \e$(7"f\e(B \e$(7"g\e(B \e$(7"h\e(B \e$(7"i\e(B \e$(7"j\e(B \e$(7"k\e(B \e$(7"l\e(B \e$(7"m\e(B \e$(7"n\e(B \e$(7"o\e(B ; Long vowels and
58 ;;;2270 \e$(7"p\e(B \e$(7"q\e(B \e$(7"r\e(B \e$(7"s\e(B \e$(7"t\e(B \e$(7"u\e(B \e$(7"v\e(B \e$(7"w\e(B \e$(7"x\e(B \e$(7"y\e(B \e$(7"z\e(B \e$(7"{\e(B \e$(7"|\e(B \e$(7"}\e(B \e$(7"~\e(B // ; vocalic r, l ARE
59 ;;; ; atomically
60 ;;; ; encoded.
61 ;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
62 ;;;2320 // \e$(7#!\e(B \e$(7#"\e(B \e$(7##\e(B \e$(7#$\e(B \e$(7#%\e(B \e$(7#&\e(B \e$(7#'\e(B \e$(7#(\e(B \e$(7#)\e(B \e$(7#*\e(B \e$(7#+\e(B \e$(7#,\e(B \e$(7#-\e(B \e$(7#.\e(B \e$(7#/\e(B ; Subjoined consonants
63 ;;;2330 \e$(7#0\e(B \e$(7#1\e(B \e$(7#2\e(B \e$(7#3\e(B \e$(7#4\e(B \e$(7#5\e(B \e$(7#6\e(B \e$(7#7\e(B \e$(7#8\e(B \e$(7#9\e(B \e$(7#:\e(B \e$(7#;\e(B \e$(7#<\e(B \e$(7#=\e(B \e$(7#>\e(B \e$(7#?\e(B ;
64 ;;;2340 \e$(7#@\e(B \e$(7#A\e(B \e$(7#B\e(B \e$(7#C\e(B \e$(7#D\e(B \e$(7#E\e(B \e$(7#F\e(B \e$(7#G\e(B \e$(7#H\e(B \e$(7#I\e(B \e$(7#J\e(B \e$(7#K\e(B \e$(7#L\e(B \e$(7#M\e(B \e$(7#N\e(B \e$(7#O\e(B ;
65 ;;;2350 \e$(7#P\e(B \e$(7#Q\e(B \e$(7#R\e(B \e$(7#S\e(B \e$(7#T\e(B \e$(7#U\e(B \e$(7#V\e(B \e$(7#W\e(B \e$(7#X\e(B \e$(7#Y\e(B \e$(7#Z\e(B \e$(7#[\e(B \e$(7#\\e(B \e$(7#]\e(B \e$(7#^\e(B \e$(7#_\e(B ; Hereafter, the chars
66 ;;;2360 \e$(7#`\e(B \e$(7#a\e(B \e$(7#b\e(B \e$(7#c\e(B \e$(7#d\e(B \e$(7#e\e(B \e$(7#f\e(B \e$(7#g\e(B \e$(7#h\e(B \e$(7#i\e(B \e$(7#j\e(B \e$(7#k\e(B \e$(7#l\e(B \e$(7#m\e(B \e$(7#n\e(B \e$(7#o\e(B ; are not specified
67 ;;;2370 \e$(7#p\e(B \e$(7#q\e(B \e$(7#r\e(B \e$(7#s\e(B \e$(7#t\e(B \e$(7#u\e(B \e$(7#v\e(B \e$(7#w\e(B \e$(7#x\e(B \e$(7#y\e(B \e$(7#z\e(B \e$(7#{\e(B \e$(7#|\e(B \e$(7#}\e(B \e$(7#~\e(B // ; in Unicode.
68 ;;;
69 ;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
70 ;;;2420 // \e$(7$!\e(B \e$(7$"\e(B \e$(7$#\e(B \e$(7$$\e(B \e$(7$%\e(B \e$(7$&\e(B \e$(7$'\e(B \e$(7$(\e(B \e$(7$)\e(B \e$(7$*\e(B \e$(7$+\e(B \e$(7$,\e(B \e$(7$-\e(B \e$(7$.\e(B \e$(7$/\e(B ; Precomposed
71 ;;;2430 \e$(7$0\e(B \e$(7$1\e(B \e$(7$2\e(B \e$(7$3\e(B \e$(7$4\e(B \e$(7$5\e(B \e$(7$6\e(B \e$(7$7\e(B \e$(7$8\e(B \e$(7$9\e(B \e$(7$:\e(B \e$(7$;\e(B \e$(7$<\e(B \e$(7$=\e(B \e$(7$>\e(B \e$(7$?\e(B ; consonants for
72 ;;;2440 \e$(7$@\e(B \e$(7$A\e(B \e$(7$B\e(B \e$(7$C\e(B \e$(7$D\e(B \e$(7$E\e(B \e$(7$F\e(B \e$(7$G\e(B \e$(7$H\e(B \e$(7$I\e(B \e$(7$J\e(B \e$(7$K\e(B \e$(7$L\e(B \e$(7$M\e(B \e$(7$N\e(B \e$(7$O\e(B ; ordinary Tibetan.
73 ;;;2450 \e$(7$P\e(B \e$(7$Q\e(B \e$(7$R\e(B \e$(7$S\e(B \e$(7$T\e(B \e$(7$U\e(B \e$(7$V\e(B \e$(7$W\e(B \e$(7$X\e(B \e$(7$Y\e(B \e$(7$Z\e(B \e$(7$[\e(B \e$(7$\\e(B \e$(7$]\e(B \e$(7$^\e(B \e$(7$_\e(B ; They are decomposed
74 ;;;2460 \e$(7$`\e(B \e$(7$a\e(B \e$(7$b\e(B \e$(7$c\e(B \e$(7$d\e(B \e$(7$e\e(B \e$(7$f\e(B \e$(7$g\e(B \e$(7$h\e(B \e$(7$i\e(B \e$(7$j\e(B \e$(7$k\e(B \e$(7$l\e(B \e$(7$m\e(B \e$(7$n\e(B \e$(7$o\e(B ; into base and
75 ;;;2470 \e$(7$p\e(B \e$(7$q\e(B \e$(7$r\e(B \e$(7$s\e(B \e$(7$t\e(B \e$(7$u\e(B \e$(7$v\e(B \e$(7$w\e(B \e$(7$x\e(B \e$(7$y\e(B \e$(7$z\e(B \e$(7${\e(B \e$(7$|\e(B \e$(7$}\e(B \e$(7$~\e(B // ; subjoined consonants
76 ;;; ; when written on a
77 ;;; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ; file in Tibetan
78 ;;;2520 // \e$(7%!\e(B \e$(7%"\e(B \e$(7%#\e(B \e$(7%$\e(B \e$(7%%\e(B \e$(7%&\e(B \e$(7%'\e(B \e$(7%(\e(B \e$(7%)\e(B \e$(7%*\e(B \e$(7%+\e(B \e$(7%,\e(B \e$(7%-\e(B \e$(7%.\e(B \e$(7%/\e(B ; coding system.
79 ;;;2530 \e$(7%0\e(B \e$(7%1\e(B \e$(7%2\e(B \e$(7%3\e(B \e$(7%4\e(B \e$(7%5\e(B \e$(7%6\e(B \e$(7%7\e(B \e$(7%8\e(B \e$(7%9\e(B \e$(7%:\e(B \e$(7%;\e(B \e$(7%<\e(B \e$(7%=\e(B \e$(7%>\e(B \e$(7%?\e(B ;
80 ;;;2540 \e$(7%@\e(B \e$(7%A\e(B \e$(7%B\e(B \e$(7%C\e(B \e$(7%D\e(B \e$(7%E\e(B \e$(7%F\e(B \e$(7%G\e(B \e$(7%H\e(B \e$(7%I\e(B \e$(7%J\e(B \e$(7%K\e(B \e$(7%L\e(B \e$(7%M\e(B \e$(7%N\e(B \e$(7%O\e(B ;
81 ;;;2550 \e$(7%P\e(B \e$(7%Q\e(B \e$(7%R\e(B \e$(7%S\e(B \e$(7%T\e(B \e$(7%U\e(B \e$(7%V\e(B \e$(7%W\e(B \e$(7%X\e(B \e$(7%Y\e(B \e$(7%Z\e(B \e$(7%[\e(B \e$(7%\\e(B \e$(7%]\e(B \e$(7%^\e(B \e$(7%_\e(B ;
82 ;;;2560 \e$(7%`\e(B \e$(7%a\e(B \e$(7%b\e(B \e$(7%c\e(B \e$(7%d\e(B \e$(7%e\e(B \e$(7%f\e(B \e$(7%g\e(B \e$(7%h\e(B \e$(7%i\e(B \e$(7%j\e(B \e$(7%k\e(B \e$(7%l\e(B \e$(7%m\e(B \e$(7%n\e(B \e$(7%o\e(B ;
83 ;;;2570 \e$(7%p\e(B \e$(7%q\e(B \e$(7%r\e(B \e$(7%s\e(B \e$(7%t\e(B \e$(7%u\e(B \e$(7%v\e(B \e$(7%w\e(B \e$(7%x\e(B \e$(7%y\e(B \e$(7%z\e(B \e$(7%{\e(B \e$(7%|\e(B \e$(7%}\e(B \e$(7%~\e(B // ;
84 ;;;
85
86
87 (make-coding-system
88 'tibetan-iso-8bit 2 ?Q
89 "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)."
90 '(ascii tibetan nil nil
91 nil nil)
92 '((safe-charsets ascii tibetan)
93 (post-read-conversion . tibetan-post-read-conversion)
94 (pre-write-conversion . tibetan-pre-write-conversion)))
95
96 (define-coding-system-alias 'tibetan 'tibetan-iso-8bit)
97
98 (set-language-info-alist
99 "Tibetan" '((charset tibetan tibetan-1-column)
100 (coding-system tibetan-iso-8bit)
101 (coding-priority iso-2022-7bit tibetan-iso-8bit)
102 (input-method . "tibetan-wylie")
103 (features tibet-util)
104 (documentation . t)
105 (sample-text
106 . (tibetan-compose-string
107 (copy-sequence
108 "Tibetan (\e4\e$(7"7r'"]\e0"7"]\e1\e4"2\e0"2\e1!;\e4%P\e0"G#!"Q\e1\e4"2\e0"2\e1!;\e(B) \e$(7!4!5!5!>\e4"7\e0"7\e1\e4$P\e0"!#C"Q\e1!;\e4"Er'"S\e0"E"S\e1\e4"G\e0"G\e1!;\e4"7\e0"7\e1\e4"2r'"[\e0"2"[\e1!;\e4"Dr'"[\e0"D"[\e1\e4"#\e0"#\e1\e4"G\e0"G\e1!>\e4"Ir'"]r'"_\e0"I"]"_\e1!;\e4"9\e0"9"Q\e1!;\e4"/r'"S\e0"/"S\e1!;\e4"5\e0"5"Q\e1\e4#2x!#9r'"[\e0"2#9"[\e1!;\e4"Hx!"Rx!"Ur'"c\e0"H"A"U"c\e1!>\e(B")))))
109
110
111 ;; `\e$(7"A\e(B' is included in the pattern for subjoined consonants because we
112 ;; treat it specially in tibetan-add-components.
113 ;; modified by Tomabechi 1999/12/10
114 ;; modified by Tomabechi 2000/06/08
115 ;; To allow infinite addition of vowels/modifiers
116 ;; as specified in Unicode v.3
117 ;; \e$(7"A\e(B is removed from the class of subjoined. Tomabechi 2000/06/08
118 ;; (for Unicode support)
119 (defconst tibetan-composable-pattern
120 "[\e$(7"!\e(B-\e$(7"J"K\e(B][\e$(7#!\e(B-\e$(7#J#K#L#M\e(B]*[\e$(7"Q"R"S\e(B-\e$(7"^"a"b"e\e(B]*[\e$(7"_"c"d"g\e(B-\e$(7"l!I!e!g\e(B]*"
121 "Regexp matching a composable sequence of Tibetan characters.")
122
123 ;; Register a function to compose Tibetan characters.
124 (aset composition-function-table (make-char 'tibetan)
125 (list (cons tibetan-composable-pattern 'tibetan-composition-function)))
126
127 ;;;
128 ;;; Definitions of conversion data.
129 ;;;
130
131
132 ;;; alists for tibetan char <-> transcription conversion
133 ;;; longer transcription should come first
134 (defconst tibetan-consonant-transcription-alist
135 '(("tsh" . "\e$(7";\e(B")
136 ("dzh" . "\e$(7"=\e(B")
137 ("kSH" . "\e$(7"J\e(B")
138 ("kh" . "\e$(7""\e(B")
139 ("gh" . "\e$(7"$\e(B")
140 ("ng" . "\e$(7"%\e(B")
141 ("ch" . "\e$(7"'\e(B")
142 ("ny" . "\e$(7"*\e(B")
143 ("TH" . "\e$(7",\e(B")
144 ("DH" . "\e$(7".\e(B")
145 ("th" . "\e$(7"1\e(B")
146 ("dh" . "\e$(7"3\e(B")
147 ("ph" . "\e$(7"6\e(B")
148 ("bh" . "\e$(7"8\e(B")
149 ("ts" . "\e$(7":\e(B")
150 ("dz" . "\e$(7"<\e(B")
151 ("zh" . "\e$(7"?\e(B")
152 ("sh" . "\e$(7"E\e(B")
153 ("SH" . "\e$(7"F\e(B")
154 ("k" . "\e$(7"!\e(B")
155 ("g" . "\e$(7"#\e(B")
156 ("c" . "\e$(7"&\e(B")
157 ("j" . "\e$(7"(\e(B")
158 ("T" . "\e$(7"+\e(B")
159 ("D" . "\e$(7"-\e(B")
160 ("N" . "\e$(7"/\e(B")
161 ("t" . "\e$(7"0\e(B")
162 ("d" . "\e$(7"2\e(B")
163 ("n" . "\e$(7"4\e(B")
164 ("p" . "\e$(7"5\e(B")
165 ("b" . "\e$(7"7\e(B")
166 ("m" . "\e$(7"9\e(B")
167 ("w" . "\e$(7">\e(B")
168 ("z" . "\e$(7"@\e(B")
169 ("'" . "\e$(7"A\e(B")
170 ("y" . "\e$(7"B\e(B")
171 ("r" . "\e$(7"C\e(B")
172 ("l" . "\e$(7"D\e(B")
173 ("s" . "\e$(7"G\e(B")
174 ("h" . "\e$(7"H\e(B")
175 ("H" . "\e$(7"H\e(B")
176 ("A" . "\e$(7"I\e(B")
177 ;; Added by Tomabechi 1999/12/10
178 ("R" . "\e$(7"K\e(B") ;; fixed form RA
179 ))
180
181
182 (defconst tibetan-vowel-transcription-alist
183 '(
184 ;; Composite Vowels
185 ;; Added by Tomabechi 2000/06/08
186 ("frr" . "\e$(7"X\e(B")
187 ("fll" . "\e$(7"Z\e(B")
188 ("fa" . "\e$(7"R\e(B")
189 ("fi" . "\e$(7"T\e(B")
190 ("fu" . "\e$(7"V\e(B")
191 ("fr" . "\e$(7"W\e(B")
192 ("fl" . "\e$(7"Y\e(B")
193 ("fI" . "\e$(7"b\e(B")
194 ;; Normal Vowels
195 ("ai" . "\e$(7"\\e(B")
196 ("au" . "\e$(7"^\e(B")
197 ("ee" . "\e$(7"\\e(B")
198 ("oo" . "\e$(7"^\e(B")
199 ("a" . "\e$(7"Q\e(B") ; invisible vowel sign (\x2251)
200 ("i" . "\e$(7"S\e(B")
201 ("u" . "\e$(7"U\e(B")
202 ("e" . "\e$(7"[\e(B")
203 ("o" . "\e$(7"]\e(B")
204 ("E" . "\e$(7"\\e(B")
205 ("O" . "\e$(7"^\e(B")
206 ("I" . "\e$(7"a\e(B")
207 ("," . "\e$(7"e\e(B") ; idem.
208 ))
209
210 (defconst tibetan-modifier-transcription-alist
211 '(("M" . "\e$(7"_\e(B")
212 ("~" . "\e$(7"c\e(B")
213 ("`" . "\e$(7"d\e(B")
214 ("x" . "\e$(7"i\e(B")
215 ("X" . "\e$(7"j\e(B")
216 ("v" . "\e$(7"g\e(B")
217 ("V" . "\e$(7"h\e(B")
218 ("q" . "\e$(7"k\e(B")
219 ("Q" . "\e$(7"l\e(B")
220 ("_/" . "\e$(7!I\e(B")
221 ("_o" . "\e$(7!g\e(B")
222 ("_O" . "\e$(7!e\e(B")))
223
224 (defconst tibetan-precomposed-transcription-alist
225 '(("phyw" . "\e$(7$G\e(B")
226 ("tshw" . "\e$(7$)\e(B")
227 ("rtsw" . "\e$(7%.\e(B")
228 ("khw" . "\e$(7$"\e(B")
229 ("nyw" . "\e$(7$%\e(B")
230 ("tsw" . "\e$(7$(\e(B")
231 ("zhw" . "\e$(7$*\e(B")
232 ("shw" . "\e$(7$.\e(B")
233 ("khy" . "\e$(7$A\e(B")
234 ("phy" . "\e$(7$D\e(B")
235 ("khr" . "\e$(7$Q\e(B")
236 ("thr" . "\e$(7$T\e(B")
237 ("phr" . "\e$(7$W\e(B")
238 ("shr" . "\e$(7$Z\e(B")
239 ("dzr" . "\e$(7$^\e(B")
240 ("grw" . "\e$(7$_\e(B")
241 ("rng" . "\e$(7%#\e(B")
242 ("rny" . "\e$(7%%\e(B")
243 ("rts" . "\e$(7%+\e(B")
244 ("rdz" . "\e$(7%,\e(B")
245 ("rgw" . "\e$(7%-\e(B")
246 ("rky" . "\e$(7%0\e(B")
247 ("rgy" . "\e$(7%1\e(B")
248 ("rmy" . "\e$(7%2\e(B")
249 ("lng" . "\e$(7%B\e(B")
250 ("sng" . "\e$(7%R\e(B")
251 ("sny" . "\e$(7%S\e(B")
252 ("sts" . "\e$(7%Z\e(B")
253 ("sky" . "\e$(7%`\e(B")
254 ("sgy" . "\e$(7%a\e(B")
255 ("spy" . "\e$(7%b\e(B")
256 ("sby" . "\e$(7%c\e(B")
257 ("smy" . "\e$(7%d\e(B")
258 ("skr" . "\e$(7%p\e(B")
259 ("sgr" . "\e$(7%q\e(B")
260 ("snr" . "\e$(7%r\e(B")
261 ("spr" . "\e$(7%s\e(B")
262 ("sbr" . "\e$(7%t\e(B")
263 ("smr" . "\e$(7%u\e(B")
264 ("kw" . "\e$(7$!\e(B")
265 ("gw" . "\e$(7$#\e(B")
266 ("cw" . "\e$(7$$\e(B")
267 ("tw" . "\e$(7$&\e(B")
268 ("dw" . "\e$(7$'\e(B")
269 ("zw" . "\e$(7$+\e(B")
270 ("rw" . "\e$(7$,\e(B")
271 ("lw" . "\e$(7$-\e(B")
272 ("sw" . "\e$(7$/\e(B")
273 ("hw" . "\e$(7$0\e(B")
274 ("ky" . "\e$(7$@\e(B")
275 ("gy" . "\e$(7$B\e(B")
276 ("py" . "\e$(7$C\e(B")
277 ("by" . "\e$(7$E\e(B")
278 ("my" . "\e$(7$F\e(B")
279 ("kr" . "\e$(7$P\e(B")
280 ("gr" . "\e$(7$R\e(B")
281 ("tr" . "\e$(7$S\e(B")
282 ("dr" . "\e$(7$U\e(B")
283 ("pr" . "\e$(7$V\e(B")
284 ("brk" . "\e$(7"7%!\e(B")
285 ("brg" . "\e$(7"7%"\e(B")
286 ("brng" . "\e$(7"7%#\e(B")
287 ("brj" . "\e$(7"7%$\e(B")
288 ("brny" . "\e$(7"7%%\e(B")
289 ("brt" . "\e$(7"7%&\e(B")
290 ("brd" . "\e$(7"7%'\e(B")
291 ("brn" . "\e$(7"7%(\e(B")
292 ("brts" . "\e$(7"7%+\e(B")
293 ("brdz" . "\e$(7"7%,\e(B")
294 ("brl" . "\e$(7"7$d\e(B")
295 ("br" . "\e$(7$X\e(B")
296 ("mr" . "\e$(7$Y\e(B")
297 ("sr" . "\e$(7$[\e(B")
298 ("hr" . "\e$(7$\\e(B")
299 ("jr" . "\e$(7$]\e(B")
300 ("kl" . "\e$(7$`\e(B")
301 ("gl" . "\e$(7$a\e(B")
302 ("blt" . "\e$(7"7%E\e(B")
303 ("bld" . "\e$(7"7%F\e(B")
304 ("bl" . "\e$(7$b\e(B")
305 ("zl" . "\e$(7$c\e(B")
306 ("rl" . "\e$(7$d\e(B")
307 ("sl" . "\e$(7$e\e(B")
308 ("rk" . "\e$(7%!\e(B")
309 ("rg" . "\e$(7%"\e(B")
310 ("rj" . "\e$(7%$\e(B")
311 ("rt" . "\e$(7%&\e(B")
312 ("rd" . "\e$(7%'\e(B")
313 ("rn" . "\e$(7%(\e(B")
314 ("rb" . "\e$(7%)\e(B")
315 ("rm" . "\e$(7%*\e(B")
316 ("lk" . "\e$(7%@\e(B")
317 ("lg" . "\e$(7%A\e(B")
318 ("lc" . "\e$(7%C\e(B")
319 ("lj" . "\e$(7%D\e(B")
320 ("lt" . "\e$(7%E\e(B")
321 ("ld" . "\e$(7%F\e(B")
322 ("ln" . "\e$(7!!\e(B") ; dummy \x2121
323 ("lp" . "\e$(7%G\e(B")
324 ("lb" . "\e$(7%H\e(B")
325 ("lh" . "\e$(7%I\e(B")
326 ("sk" . "\e$(7%P\e(B")
327 ("sg" . "\e$(7%Q\e(B")
328 ("st" . "\e$(7%T\e(B")
329 ("sd" . "\e$(7%U\e(B")
330 ("sn" . "\e$(7%V\e(B")
331 ("sp" . "\e$(7%W\e(B")
332 ("sb" . "\e$(7%X\e(B")
333 ("sm" . "\e$(7%Y\e(B"))
334 )
335
336
337 (defconst tibetan-subjoined-transcription-alist
338 (sort '(("+k" . "\e$(7#!\e(B")
339 ("+kh" . "\e$(7#"\e(B")
340 ("+g" . "\e$(7##\e(B")
341 ("+gh" . "\e$(7#$\e(B")
342 ("+ng" . "\e$(7#%\e(B")
343 ("+c" . "\e$(7#&\e(B")
344 ("+ch" . "\e$(7#'\e(B")
345 ("+j" . "\e$(7#(\e(B")
346 ("+ny" . "\e$(7#*\e(B")
347 ("+T" . "\e$(7#+\e(B")
348 ("+TH" . "\e$(7#,\e(B")
349 ("+D" . "\e$(7#-\e(B")
350 ("+DH" . "\e$(7#.\e(B")
351 ("+N" . "\e$(7#/\e(B")
352 ("+t" . "\e$(7#0\e(B")
353 ("+th" . "\e$(7#1\e(B")
354 ("+d" . "\e$(7#2\e(B")
355 ("+dh" . "\e$(7#3\e(B")
356 ("+n" . "\e$(7#4\e(B")
357 ("+p" . "\e$(7#5\e(B")
358 ("+ph" . "\e$(7#6\e(B")
359 ("+b" . "\e$(7#7\e(B")
360 ("+bh" . "\e$(7#8\e(B")
361 ("+m" . "\e$(7#9\e(B")
362 ("+ts" . "\e$(7#:\e(B")
363 ("+tsh" . "\e$(7#;\e(B")
364 ("+dz" . "\e$(7#<\e(B")
365 ("+dzh" . "\e$(7#=\e(B")
366 ("+w" . "\e$(7#>\e(B")
367 ("+zh" . "\e$(7#?\e(B")
368 ("+z" . "\e$(7#@\e(B")
369 ("+'" . "\e$(7#A\e(B")
370 ("+y" . "\e$(7#B\e(B")
371 ("+r" . "\e$(7#C\e(B")
372 ("+l" . "\e$(7#D\e(B")
373 ("+sh" . "\e$(7#E\e(B")
374 ("+SH" . "\e$(7#F\e(B")
375 ("+s" . "\e$(7#G\e(B")
376 ("+h" . "\e$(7#H\e(B")
377 ("+A" . "\e$(7#I\e(B")
378 ("+kSH" . "\e$(7#J\e(B")
379 ;; Added by Tomabechi 1999/12/10
380 ("+W" . "\e$(7#K\e(B") ;; fixed form subscribed WA
381 ("+Y" . "\e$(7#L\e(B") ;; fixed form subscribed YA
382 ("+R" . "\e$(7#M\e(B") ;; fixed form subscribed RA
383 )
384 (lambda (x y) (> (length (car x)) (length (car y))))))
385
386 ;;;
387 ;;; alist for Tibetan base consonant <-> subjoined consonant conversion.
388 ;;;
389 (defconst tibetan-base-to-subjoined-alist
390 '(("\e$(7"!\e(B" . "\e$(7#!\e(B")
391 ("\e$(7""\e(B" . "\e$(7#"\e(B")
392 ("\e$(7"#\e(B" . "\e$(7##\e(B")
393 ("\e$(7"$\e(B" . "\e$(7#$\e(B")
394 ("\e$(7"%\e(B" . "\e$(7#%\e(B")
395 ("\e$(7"&\e(B" . "\e$(7#&\e(B")
396 ("\e$(7"'\e(B" . "\e$(7#'\e(B")
397 ("\e$(7"(\e(B" . "\e$(7#(\e(B")
398 ("\e$(7"*\e(B" . "\e$(7#*\e(B")
399 ("\e$(7"+\e(B" . "\e$(7#+\e(B")
400 ("\e$(7",\e(B" . "\e$(7#,\e(B")
401 ("\e$(7"-\e(B" . "\e$(7#-\e(B")
402 ("\e$(7".\e(B" . "\e$(7#.\e(B")
403 ("\e$(7"/\e(B" . "\e$(7#/\e(B")
404 ("\e$(7"0\e(B" . "\e$(7#0\e(B")
405 ("\e$(7"1\e(B" . "\e$(7#1\e(B")
406 ("\e$(7"2\e(B" . "\e$(7#2\e(B")
407 ("\e$(7"3\e(B" . "\e$(7#3\e(B")
408 ("\e$(7"4\e(B" . "\e$(7#4\e(B")
409 ("\e$(7"5\e(B" . "\e$(7#5\e(B")
410 ("\e$(7"6\e(B" . "\e$(7#6\e(B")
411 ("\e$(7"7\e(B" . "\e$(7#7\e(B")
412 ("\e$(7"8\e(B" . "\e$(7#8\e(B")
413 ("\e$(7"9\e(B" . "\e$(7#9\e(B")
414 ("\e$(7":\e(B" . "\e$(7#:\e(B")
415 ("\e$(7";\e(B" . "\e$(7#;\e(B")
416 ("\e$(7"<\e(B" . "\e$(7#<\e(B")
417 ("\e$(7"=\e(B" . "\e$(7#=\e(B")
418 ("\e$(7">\e(B" . "\e$(7#>\e(B")
419 ("\e$(7"?\e(B" . "\e$(7#?\e(B")
420 ("\e$(7"@\e(B" . "\e$(7#@\e(B")
421 ("\e$(7"A\e(B" . "\e$(7#A\e(B")
422 ("\e$(7"B\e(B" . "\e$(7#B\e(B")
423 ("\e$(7"C\e(B" . "\e$(7#C\e(B")
424 ("\e$(7"D\e(B" . "\e$(7#D\e(B")
425 ("\e$(7"E\e(B" . "\e$(7#E\e(B")
426 ("\e$(7"F\e(B" . "\e$(7#F\e(B")
427 ("\e$(7"G\e(B" . "\e$(7#G\e(B")
428 ("\e$(7"H\e(B" . "\e$(7#H\e(B")
429 ("\e$(7"I\e(B" . "\e$(7#I\e(B")
430 ("\e$(7"J\e(B" . "\e$(7#J\e(B")
431 ;; Added by Tomabechi 1999/12/10
432 ("\e$(7"K\e(B" . "\e$(7#M\e(B") ;; Fixed form RA (224B->234D)
433 ))
434
435 ;;; alist for Tibetan composite vowels (long i, vocalic r, etc.)
436 ;;; New varialble. created by Tomabechi 2000/06/08
437 (defconst tibetan-composite-vowel-alist
438 '(;; LONG A
439 ;; ("\e$(7"R\e(B" . ((bc . tc) ?\e$(7"R\e(B))
440 ;; LONG I
441 ("\e$(7"T\e(B" . (?\e$(7"R\e(B (tc . bc) ?\e$(7"S\e(B))
442 ;; LONG U
443 ("\e$(7"V\e(B" . (?\e$(7"R\e(B (bc . tc) ?\e$(7"U\e(B))
444 ;; VOCALIC R
445 ("\e$(7"W\e(B" . (?\e$(7#C\e(B (tc . bc) ?\e$(7"a\e(B))
446 ;; LONG VOCALIC R
447 ("\e$(7"X\e(B" . (?\e$(7#C\e(B (bc . tc) ?\e$(7"R\e(B (tc . bc) ?\e$(7"a\e(B))
448 ;; VOCALIC L
449 ("\e$(7"Y\e(B" . (?\e$(7#D\e(B (tc . bc) ?\e$(7"a\e(B))
450 ;;\e$(7!;\e(BLONG VOCALIC L
451 ("\e$(7"Z\e(B" . (?\e$(7#D\e(B (bc . tc) ?\e$(7"R\e(B (tc . bc) ?\e$(7"a\e(B))
452 ;; LONG REVERSE I
453 ("\e$(7"b\e(B" . (?\e$(7"R\e(B (tc . bc) ?\e$(7"a\e(B))
454 ))
455
456
457
458 ;;;
459 ;;; alist for Tibetan consonantic components <-> precomposed glyph conversion.
460 ;;; (includes some punctuation conversion rules)
461 ;;;
462 (defconst tibetan-precomposition-rule-alist
463 `(("\e$(7"6#B#>\e(B" . "\e$(7$G\e(B")
464 ("\e$(7"##C#>\e(B" . "\e$(7$_\e(B")
465 ("\e$(7";#>\e(B" . "\e$(7$)\e(B")
466 ("\e$(7"C#:#>\e(B" . "\e$(7%.\e(B")
467 ("\e$(7"C###>\e(B" . "\e$(7%-\e(B")
468 ("\e$(7"C#!#B\e(B" . "\e$(7%0\e(B")
469 ("\e$(7"C###B\e(B" . "\e$(7%1\e(B")
470 ("\e$(7"C#9#B\e(B" . "\e$(7%2\e(B")
471 ("\e$(7"G#!#B\e(B" . "\e$(7%`\e(B")
472 ("\e$(7"G###B\e(B" . "\e$(7%a\e(B")
473 ("\e$(7"G#5#B\e(B" . "\e$(7%b\e(B")
474 ("\e$(7"G#7#B\e(B" . "\e$(7%c\e(B")
475 ("\e$(7"G#9#B\e(B" . "\e$(7%d\e(B")
476 ("\e$(7"G#!#C\e(B" . "\e$(7%p\e(B")
477 ("\e$(7"G###C\e(B" . "\e$(7%q\e(B")
478 ("\e$(7"G#4#C\e(B" . "\e$(7%r\e(B")
479 ("\e$(7"G#5#C\e(B" . "\e$(7%s\e(B")
480 ("\e$(7"G#7#C\e(B" . "\e$(7%t\e(B")
481 ("\e$(7"G#9#C\e(B" . "\e$(7%u\e(B")
482 ("\e$(7""#>\e(B" . "\e$(7$"\e(B")
483 ("\e$(7"*#>\e(B" . "\e$(7$%\e(B")
484 ("\e$(7":#>\e(B" . "\e$(7$(\e(B")
485 ("\e$(7"?#>\e(B" . "\e$(7$*\e(B")
486 ("\e$(7"E#>\e(B" . "\e$(7$.\e(B")
487 ("\e$(7""#B\e(B" . "\e$(7$A\e(B")
488 ("\e$(7"6#B\e(B" . "\e$(7$D\e(B")
489 ("\e$(7""#C\e(B" . "\e$(7$Q\e(B")
490 ("\e$(7"1#C\e(B" . "\e$(7$T\e(B")
491 ("\e$(7"6#C\e(B" . "\e$(7$W\e(B")
492 ("\e$(7"E#C\e(B" . "\e$(7$Z\e(B")
493 ("\e$(7"<#C\e(B" . "\e$(7$^\e(B")
494 ("\e$(7"C#%\e(B" . "\e$(7%#\e(B")
495 ("\e$(7"C#*\e(B" . "\e$(7%%\e(B")
496 ("\e$(7"C#:\e(B" . "\e$(7%+\e(B")
497 ("\e$(7"C#<\e(B" . "\e$(7%,\e(B")
498 ("\e$(7"D#%\e(B" . "\e$(7%B\e(B")
499 ("\e$(7"G#%\e(B" . "\e$(7%R\e(B")
500 ("\e$(7"G#*\e(B" . "\e$(7%S\e(B")
501 ("\e$(7"G#:\e(B" . "\e$(7%Z\e(B")
502 ("\e$(7"!#>\e(B" . "\e$(7$!\e(B")
503 ("\e$(7"##>\e(B" . "\e$(7$#\e(B")
504 ("\e$(7"&#>\e(B" . "\e$(7$$\e(B")
505 ("\e$(7"0#>\e(B" . "\e$(7$&\e(B")
506 ("\e$(7"2#>\e(B" . "\e$(7$'\e(B")
507 ("\e$(7"@#>\e(B" . "\e$(7$+\e(B")
508 ("\e$(7"C#>\e(B" . "\e$(7$,\e(B")
509 ("\e$(7"D#>\e(B" . "\e$(7$-\e(B")
510 ("\e$(7"G#>\e(B" . "\e$(7$/\e(B")
511 ("\e$(7"H#>\e(B" . "\e$(7$0\e(B")
512 ("\e$(7"!#B\e(B" . "\e$(7$@\e(B")
513 ("\e$(7"##B\e(B" . "\e$(7$B\e(B")
514 ("\e$(7"5#B\e(B" . "\e$(7$C\e(B")
515 ("\e$(7"7#B\e(B" . "\e$(7$E\e(B")
516 ("\e$(7"9#B\e(B" . "\e$(7$F\e(B")
517 ("\e$(7"!#C\e(B" . "\e$(7$P\e(B")
518 ("\e$(7"##C\e(B" . "\e$(7$R\e(B")
519 ("\e$(7"0#C\e(B" . "\e$(7$S\e(B")
520 ("\e$(7"2#C\e(B" . "\e$(7$U\e(B")
521 ("\e$(7"5#C\e(B" . "\e$(7$V\e(B")
522 ("\e$(7"7#C\e(B" . "\e$(7$X\e(B")
523 ("\e$(7"9#C\e(B" . "\e$(7$Y\e(B")
524 ("\e$(7"G#C\e(B" . "\e$(7$[\e(B")
525 ("\e$(7"H#C\e(B" . "\e$(7$\\e(B")
526 ("\e$(7"(#C\e(B" . "\e$(7$]\e(B")
527 ("\e$(7"!#D\e(B" . "\e$(7$`\e(B")
528 ("\e$(7"##D\e(B" . "\e$(7$a\e(B")
529 ("\e$(7"7#D\e(B" . "\e$(7$b\e(B")
530 ("\e$(7"@#D\e(B" . "\e$(7$c\e(B")
531 ("\e$(7"C#D\e(B" . "\e$(7$d\e(B")
532 ("\e$(7"G#D\e(B" . "\e$(7$e\e(B")
533 ("\e$(7"C#!\e(B" . "\e$(7%!\e(B")
534 ("\e$(7"C##\e(B" . "\e$(7%"\e(B")
535 ("\e$(7"C#(\e(B" . "\e$(7%$\e(B")
536 ("\e$(7"C#0\e(B" . "\e$(7%&\e(B")
537 ("\e$(7"C#2\e(B" . "\e$(7%'\e(B")
538 ("\e$(7"C#4\e(B" . "\e$(7%(\e(B")
539 ("\e$(7"C#7\e(B" . "\e$(7%)\e(B")
540 ("\e$(7"C#9\e(B" . "\e$(7%*\e(B")
541 ("\e$(7"D#!\e(B" . "\e$(7%@\e(B")
542 ("\e$(7"D##\e(B" . "\e$(7%A\e(B")
543 ("\e$(7"D#4\e(B" . "\e$(7!!\e(B") ; dummy 0x2121 added 2000/06/08 for transition l -> lng
544 ("\e$(7"D#&\e(B" . "\e$(7%C\e(B")
545 ("\e$(7"D#(\e(B" . "\e$(7%D\e(B")
546 ("\e$(7"D#0\e(B" . "\e$(7%E\e(B")
547 ("\e$(7"D#2\e(B" . "\e$(7%F\e(B")
548 ("\e$(7"D#5\e(B" . "\e$(7%G\e(B")
549 ("\e$(7"D#7\e(B" . "\e$(7%H\e(B")
550 ("\e$(7"D#H\e(B" . "\e$(7%I\e(B")
551 ("\e$(7"G#!\e(B" . "\e$(7%P\e(B")
552 ("\e$(7"G##\e(B" . "\e$(7%Q\e(B")
553 ("\e$(7"G#0\e(B" . "\e$(7%T\e(B")
554 ("\e$(7"G#2\e(B" . "\e$(7%U\e(B")
555 ("\e$(7"G#4\e(B" . "\e$(7%V\e(B")
556 ("\e$(7"G#5\e(B" . "\e$(7%W\e(B")
557 ("\e$(7"G#7\e(B" . "\e$(7%X\e(B")
558 ("\e$(7"G#9\e(B" . "\e$(7%Y\e(B")))
559
560 (defconst tibetan-regexp
561 (let ((l (list tibetan-precomposed-transcription-alist
562 tibetan-consonant-transcription-alist
563 tibetan-vowel-transcription-alist
564 tibetan-modifier-transcription-alist
565 tibetan-subjoined-transcription-alist))
566 (separator "\\|")
567 tail pattern)
568 (while l
569 (setq tail (car l) l (cdr l))
570 (while tail
571 (setq pattern (cons separator (cons (car (car tail)) pattern))
572 tail (cdr tail))))
573 (apply 'concat (nreverse (cdr pattern))))
574 "Regexp matching a Tibetan transcription of a composable Tibetan sequence.
575 The result of matching is to be used for indexing alists at conversion
576 from a roman transcription to the corresponding Tibetan character.")
577
578 (defvar tibetan-precomposed-regexp
579 (let ((l tibetan-precomposed-transcription-alist)
580 temp)
581 (setq temp "^\\(")
582 (setq temp
583 (concat temp (car (car l))))
584 (setq l (cdr l))
585 (while l
586 (setq temp
587 (concat temp "\\|" (car (car l))))
588 (setq l (cdr l)))
589 (concat temp "\\)"))
590 "Regexp string to match a romanized Tibetan complex consonant.
591 The result of matching is to be used for indexing alists when the input key
592 from an input method is converted to the corresponding precomposed glyph.")
593
594 (defvar tibetan-precomposition-rule-regexp
595 (let ((l tibetan-precomposition-rule-alist)
596 temp)
597 (setq temp "\\(")
598 (setq temp (concat temp (car (car l))))
599 (setq l (cdr l))
600 (while l
601 (setq temp (concat temp "\\|" (car (car l))))
602 (setq l (cdr l)))
603 (concat temp "\\)"))
604 "Regexp string to match a sequence of Tibetan consonantic components, i.e.,
605 one base consonant and one or more subjoined consonants.
606 The result of matching is to be used for indexing alist when the component
607 sequence is converted to the corresponding precomposed glyph.
608 This also matches some punctuation characters which need conversion.")
609
610 (defvar tibetan-decomposed nil)
611 (defvar tibetan-decomposed-temp nil)
612
613 (provide 'tibetan)
614
615 ;;; arch-tag: 8d37c8d7-f95d-450f-9ec2-819e61fc79a7
616 ;;; tibetan.el ends here