tibetan.el 23 KB

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