ind-util.el 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  1. ;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: iso-2022-7bit; -*-
  2. ;; Copyright (C) 2001-2012 Free Software Foundation, Inc.
  3. ;; Maintainer: KAWABATA, Taichi <kawabata@m17n.org>
  4. ;; Keywords: multilingual, Indian, Devanagari
  5. ;; This file is part of GNU Emacs.
  6. ;; GNU Emacs is free software: you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation, either version 3 of the License, or
  9. ;; (at your option) any later version.
  10. ;; GNU Emacs is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ;; GNU General Public License for more details.
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file provides conversion between UCS and various
  18. ;; transliteration schemes, such as ITRANS, kyoto-harvard and aiba
  19. ;; methods. It also provides conversion between IS 13194 and UCS.
  20. ;; Finally, this program provides the compatibility support with
  21. ;; old implementation of Devanagari script.
  22. ;;; Code:
  23. ;;; Transliteration
  24. ;; The followings provide the various transliteration schemes (such as
  25. ;; ITRANS, kyoto-harvard, and Aiba) of Indian scripts. They are also
  26. ;; used in quail/indian.el for typing Indian script in Emacs.
  27. (eval-and-compile
  28. (defun indian-regexp-of-hashtbl-keys (hashtbl)
  29. "Returns the regular expression of hashtable keys."
  30. (let (keys)
  31. (maphash (lambda (key val) (push key keys)) hashtbl)
  32. (regexp-opt keys)))
  33. (defvar indian-dev-base-table
  34. '(
  35. (;; VOWELS (18)
  36. (?$,15E(B nil) (?$,15F(B ?$,15~(B) (?$,15G(B ?$,15(B) (?$,15H(B ?$,16 (B) (?$,15I(B ?$,16!(B) (?$,15J(B ?$,16"(B)
  37. (?$,15K(B ?$,16#(B) (?$,15L(B ?$,16B(B) (?$,15M(B ?$,16%(B) (?$,15N(B ?$,16&(B) (?$,15O(B ?$,16'(B) (?$,15P(B ?$,16((B)
  38. (?$,15Q(B ?$,16)(B) (?$,15R(B ?$,16*(B) (?$,15S(B ?$,16+(B) (?$,15T(B ?$,16,(B) (?$,16@(B ?$,16$(B) (?$,16A(B ?$,16C(B))
  39. (;; CONSONANTS (currently 42, including special cases)
  40. ?$,15U(B ?$,15V(B ?$,15W(B ?$,15X(B ?$,15Y(B ;; GUTTRULS
  41. ?$,15Z(B ?$,15[(B ?$,15\(B ?$,15](B ?$,15^(B ;; PALATALS
  42. ?$,15_(B ?$,15`(B ?$,15a(B ?$,15b(B ?$,15c(B ;; CEREBRALS
  43. ?$,15d(B ?$,15e(B ?$,15f(B ?$,15g(B ?$,15h(B ?$,15i(B ;; DENTALS
  44. ?$,15j(B ?$,15k(B ?$,15l(B ?$,15m(B ?$,15n(B ;; LABIALS
  45. ?$,15o(B ?$,15p(B ?$,15q(B ?$,15r(B ?$,15s(B ?$,15t(B ?$,15u(B ;; SEMIVOWELS
  46. ?$,15v(B ?$,15w(B ?$,15x(B ?$,15y(B ;; SIBILANTS
  47. ?$,168(B ?$,169(B ?$,16:(B ?$,16;(B ?$,16<(B ?$,16=(B ?$,16>(B ?$,16?(B ;; NUKTAS
  48. "$,15\6-5^(B" "$,15U6-5w(B")
  49. (;; Misc Symbols (7)
  50. ?$,15A(B ?$,15B(B ?$,15C(B ?$,15}(B ?$,16-(B ?$,160(B ?$,16D(B)
  51. (;; Digits (10)
  52. ?$,16F(B ?$,16G(B ?$,16H(B ?$,16I(B ?$,16J(B ?$,16K(B ?$,16L(B ?$,16M(B ?$,16N(B ?$,16O(B)
  53. (;; Inscript-extra (4) (#, $, ^, *, ])
  54. "$,16-5p(B" "$,15p6-(B" "$,15d6-5p(B" "$,15v6-5p(B" "$,15|(B")))
  55. ;; Punjabi is also known as Gurmukhi.
  56. (defvar indian-pnj-base-table
  57. '(
  58. (;; VOWELS
  59. (?$,18%(B nil) (?$,18&(B ?$,18^(B) (?$,18'(B ?$,18_(B) (?$,18((B ?$,18`(B) (?$,18)(B ?$,18a(B) (?$,18*(B ?$,18b(B)
  60. nil nil nil nil (?$,18/(B ?$,18g(B) (?$,180(B ?$,18h(B)
  61. nil nil (?$,183(B ?$,18k(B) (?$,184(B ?$,18l(B) nil nil)
  62. (;; CONSONANTS
  63. ?$,185(B ?$,186(B ?$,187(B ?$,188(B ?$,189(B ;; GUTTRULS
  64. ?$,18:(B ?$,18;(B ?$,18<(B ?$,18=(B ?$,18>(B ;; PALATALS
  65. ?$,18?(B ?$,18@(B ?$,18A(B ?$,18B(B ?$,18C(B ;; CEREBRALS
  66. ?$,18D(B ?$,18E(B ?$,18F(B ?$,18G(B ?$,18H(B nil ;; DENTALS
  67. ?$,18J(B ?$,18K(B ?$,18L(B ?$,18M(B ?$,18N(B ;; LABIALS
  68. ?$,18O(B ?$,18P(B nil ?$,18R(B ?$,18S(B nil ?$,18U(B ;; SEMIVOWELS
  69. ?$,18V(B nil ?$,18X(B ?$,18Y(B ;; SIBILANTS
  70. nil ?$,18y(B ?$,18z(B ?$,18{(B ?$,18|(B nil ?$,18~(B nil ;; NUKTAS
  71. "$,18<8m8>(B" nil)
  72. (;; Misc Symbols (7)
  73. nil ?$,18"(B nil nil ?$,18m(B nil nil) ;; ek onkar, etc.
  74. (;; Digits
  75. ?$,19&(B ?$,19'(B ?$,19((B ?$,19)(B ?$,19*(B ?$,19+(B ?$,19,(B ?$,19-(B ?$,19.(B ?$,19/(B)
  76. (;; Inscript-extra (4) (#, $, ^, *, ])
  77. "$,18m8P(B" "$,18P8m(B" "$,18D8m8P(B" "$,18V8m8P(B" "$,18\(B")))
  78. (defvar indian-gjr-base-table
  79. '(
  80. (;; VOWELS
  81. (?$,19E(B nil) (?$,19F(B ?$,19~(B) (?$,19G(B ?$,19(B) (?$,19H(B ?$,1: (B) (?$,19I(B ?$,1:!(B) (?$,19J(B ?$,1:"(B)
  82. (?$,19K(B ?$,1:#(B) nil (?$,19M(B ?$,1:%(B) nil (?$,19O(B ?$,1:'(B) (?$,19P(B ?$,1:((B)
  83. (?$,19Q(B ?$,1:)(B) nil (?$,19S(B ?$,1:+(B) (?$,19T(B ?$,1:,(B) (?$,1:@(B ?$,1:$(B) nil)
  84. (;; CONSONANTS
  85. ?$,19U(B ?$,19V(B ?$,19W(B ?$,19X(B ?$,19Y(B ;; GUTTRULS
  86. ?$,19Z(B ?$,19[(B ?$,19\(B ?$,19](B ?$,19^(B ;; PALATALS
  87. ?$,19_(B ?$,19`(B ?$,19a(B ?$,19b(B ?$,19c(B ;; CEREBRALS
  88. ?$,19d(B ?$,19e(B ?$,19f(B ?$,19g(B ?$,19h(B nil ;; DENTALS
  89. ?$,19j(B ?$,19k(B ?$,19l(B ?$,19m(B ?$,19n(B ;; LABIALS
  90. ?$,19o(B ?$,19p(B nil ?$,19r(B ?$,19s(B nil ?$,19u(B ;; SEMIVOWELS
  91. ?$,19v(B ?$,19w(B ?$,19x(B ?$,19y(B ;; SIBILANTS
  92. nil nil nil nil nil nil nil nil ;; NUKTAS
  93. "$,19\:-9^(B" "$,19U:-9w(B")
  94. (;; Misc Symbols (7)
  95. ?$,19A(B ?$,19B(B ?$,19C(B ?$,19}(B ?$,1:-(B ?$,1:0(B nil)
  96. (;; Digits
  97. ?$,1:F(B ?$,1:G(B ?$,1:H(B ?$,1:I(B ?$,1:J(B ?$,1:K(B ?$,1:L(B ?$,1:M(B ?$,1:N(B ?$,1:O(B)
  98. (;; Inscript-extra (4) (#, $, ^, *, ])
  99. "$,1:-9p(B" "$,19p:-(B" "$,19d:-9p(B" "$,19v:-9p(B" "$,19|(B")))
  100. (defvar indian-ori-base-table
  101. '(
  102. (;; VOWELS
  103. (?$,1:e(B nil) (?$,1:f(B ?$,1;>(B) (?$,1:g(B ?$,1;?(B) (?$,1:h(B ?$,1;@(B) (?$,1:i(B ?$,1;A(B) (?$,1:j(B ?$,1;B(B)
  104. (?$,1:k(B ?$,1;C(B) (?$,1:l(B nil) nil nil (?$,1:o(B ?$,1;G(B) (?$,1:p(B ?$,1;H(B)
  105. nil nil (?$,1:s(B ?$,1;K(B) (?$,1:t(B ?$,1;L(B) (?$,1;`(B nil) (?$,1;a(B nil))
  106. (;; CONSONANTS
  107. ?$,1:u(B ?$,1:v(B ?$,1:w(B ?$,1:x(B ?$,1:y(B ;; GUTTRULS
  108. ?$,1:z(B ?$,1:{(B ?$,1:|(B ?$,1:}(B ?$,1:~(B ;; PALATALS
  109. ?$,1:(B ?$,1; (B ?$,1;!(B ?$,1;"(B ?$,1;#(B ;; CEREBRALS
  110. ?$,1;$(B ?$,1;%(B ?$,1;&(B ?$,1;'(B ?$,1;((B nil ;; DENTALS
  111. ?$,1;*(B ?$,1;+(B ?$,1;,(B ?$,1;-(B ?$,1;.(B ;; LABIALS
  112. ?$,1;/(B ?$,1;0(B nil ?$,1;2(B ?$,1;3(B nil nil ;; SEMIVOWELS
  113. ?$,1;6(B ?$,1;7(B ?$,1;8(B ?$,1;9(B ;; SIBILANTS
  114. nil nil nil nil ?$,1;\(B ?$,1;](B nil ?$,1;_(B ;; NUKTAS
  115. "$,1:|;M:~(B" "$,1:u;M;7(B")
  116. (;; Misc Symbols
  117. ?$,1:a(B ?$,1:b(B ?$,1:c(B ?$,1;=(B ?$,1;M(B nil nil)
  118. (;; Digits
  119. ?$,1;f(B ?$,1;g(B ?$,1;h(B ?$,1;i(B ?$,1;j(B ?$,1;k(B ?$,1;l(B ?$,1;m(B ?$,1;n(B ?$,1;o(B)
  120. (;; Inscript-extra (4) (#, $, ^, *, ])
  121. "$,1;M;0(B" "$,1;0;M(B" "$,1;$;M;0(B" "$,1;6;M;0(B" "$,1;<(B")))
  122. (defvar indian-bng-base-table
  123. '(
  124. (;; VOWELS
  125. (?$,16e(B nil) (?$,16f(B ?$,17>(B) (?$,16g(B ?$,17?(B) (?$,16h(B ?$,17@(B) (?$,16i(B ?$,17A(B) (?$,16j(B ?$,17B(B)
  126. (?$,16k(B ?$,17C(B) (?$,16l(B ?$,17b(B) nil nil (?$,16o(B ?$,17G(B) (?$,16p(B ?$,17H(B)
  127. nil nil (?$,16s(B ?$,17K(B) (?$,16t(B ?$,17L(B) (?$,17`(B ?$,17D(B) (?$,17a(B ?$,17c(B))
  128. (;; CONSONANTS
  129. ?$,16u(B ?$,16v(B ?$,16w(B ?$,16x(B ?$,16y(B ;; GUTTRULS
  130. ?$,16z(B ?$,16{(B ?$,16|(B ?$,16}(B ?$,16~(B ;; PALATALS
  131. ?$,16(B ?$,17 (B ?$,17!(B ?$,17"(B ?$,17#(B ;; CEREBRALS
  132. ?$,17$(B ?$,17%(B ?$,17&(B ?$,17'(B ?$,17((B nil ;; DENTALS
  133. ?$,17*(B ?$,17+(B ?$,17,(B ?$,17-(B ?$,17.(B ;; LABIALS
  134. ?$,17/(B ?$,170(B nil ?$,172(B nil nil nil ;; SEMIVOWELS
  135. ?$,176(B ?$,177(B ?$,178(B ?$,179(B ;; SIBILANTS
  136. nil nil nil nil ?$,17\(B ?$,17](B nil ?$,17_(B ;; NUKTAS
  137. "$,16|7M6~(B" "$,16u7M77(B")
  138. (;; Misc Symbols
  139. ?$,16a(B ?$,16b(B ?$,16c(B nil ?$,17M(B nil nil)
  140. (;; Digits
  141. ?$,17f(B ?$,17g(B ?$,17h(B ?$,17i(B ?$,17j(B ?$,17k(B ?$,17l(B ?$,17m(B ?$,17n(B ?$,17o(B)
  142. (;; Inscript-extra (4) (#, $, ^, *, ])
  143. "$,17M70(B" "$,1707M(B" "$,17$7M70(B" "$,1767M70(B" "$,17<(B")))
  144. (defvar indian-asm-base-table
  145. '(
  146. (;; VOWELS
  147. (?$,16e(B nil) (?$,16f(B ?$,17>(B) (?$,16g(B ?$,17?(B) (?$,16h(B ?$,17@(B) (?$,16i(B ?$,17A(B) (?$,16j(B ?$,17B(B)
  148. (?$,16k(B ?$,17C(B) (?$,16l(B ?$,17b(B) nil nil (?$,16o(B ?$,17G(B) (?$,16p(B ?$,17H(B)
  149. nil nil (?$,16s(B ?$,17K(B) (?$,16t(B ?$,17L(B) (?$,17`(B ?$,17D(B) (?$,17a(B ?$,17c(B))
  150. (;; CONSONANTS
  151. ?$,16u(B ?$,16v(B ?$,16w(B ?$,16x(B ?$,16y(B ;; GUTTRULS
  152. ?$,16z(B ?$,16{(B ?$,16|(B ?$,16}(B ?$,16~(B ;; PALATALS
  153. ?$,16(B ?$,17 (B ?$,17!(B ?$,17"(B ?$,17#(B ;; CEREBRALS
  154. ?$,17$(B ?$,17%(B ?$,17&(B ?$,17'(B ?$,17((B nil ;; DENTALS
  155. ?$,17*(B ?$,17+(B ?$,17,(B ?$,17-(B ?$,17.(B ;; LABIALS
  156. ?$,17/(B ?$,17p(B nil ?$,172(B nil nil ?$,17q(B ;; SEMIVOWELS
  157. ?$,176(B ?$,177(B ?$,178(B ?$,179(B ;; SIBILANTS
  158. nil nil nil nil ?$,17\(B ?$,17](B nil ?$,17_(B ;; NUKTAS
  159. "$,16|7M6~(B" "$,16u7M77(B")
  160. (;; Misc Symbols
  161. ?$,16a(B ?$,16b(B ?$,16c(B nil ?$,17M(B nil nil)
  162. (;; Digits
  163. ?$,17f(B ?$,17g(B ?$,17h(B ?$,17i(B ?$,17j(B ?$,17k(B ?$,17l(B ?$,17m(B ?$,17n(B ?$,17o(B)
  164. (;; Inscript-extra (4) (#, $, ^, *, ])
  165. "$,17M7p(B" "$,17p7M(B" "$,17$7M7p(B" "$,1767M7p(B" "$,17<(B")))
  166. (defvar indian-tlg-base-table
  167. '(
  168. (;; VOWELS
  169. (?$,1=E(B nil) (?$,1=F(B ?$,1=~(B) (?$,1=G(B ?$,1=(B) (?$,1=H(B ?$,1> (B) (?$,1=I(B ?$,1>!(B) (?$,1=J(B ?$,1>"(B)
  170. (?$,1=K(B ?$,1>#(B) (?$,1=L(B nil) nil (?$,1=O(B ?$,1>'(B) (?$,1=N(B ?$,1>&(B) (?$,1=P(B ?$,1>((B)
  171. nil (?$,1=S(B ?$,1>+(B) (?$,1=R(B ?$,1>*(B) (?$,1=T(B ?$,1>,(B) (?$,1>@(B ?$,1>$(B) (?$,1>A(B nil))
  172. (;; CONSONANTS
  173. ?$,1=U(B ?$,1=V(B ?$,1=W(B ?$,1=X(B ?$,1=Y(B ;; GUTTRULS
  174. ?$,1=Z(B ?$,1=[(B ?$,1=\(B ?$,1=](B ?$,1=^(B ;; PALATALS
  175. ?$,1=_(B ?$,1=`(B ?$,1=a(B ?$,1=b(B ?$,1=c(B ;; CEREBRALS
  176. ?$,1=d(B ?$,1=e(B ?$,1=f(B ?$,1=g(B ?$,1=h(B nil ;; DENTALS
  177. ?$,1=j(B ?$,1=k(B ?$,1=l(B ?$,1=m(B ?$,1=n(B ;; LABIALS
  178. ?$,1=o(B ?$,1=p(B ?$,1=q(B ?$,1=r(B ?$,1=s(B nil ?$,1=u(B ;; SEMIVOWELS
  179. ?$,1=v(B ?$,1=w(B ?$,1=x(B ?$,1=y(B ;; SIBILANTS
  180. nil nil nil nil nil nil nil nil ;; NUKTAS
  181. "$,1=\>-=^(B" "$,1=U>-=w(B")
  182. (;; Misc Symbols
  183. ?$,1=A(B ?$,1=B(B ?$,1=C(B nil ?$,1>-(B nil nil)
  184. (;; Digits
  185. ?$,1>F(B ?$,1>G(B ?$,1>H(B ?$,1>I(B ?$,1>J(B ?$,1>K(B ?$,1>L(B ?$,1>M(B ?$,1>N(B ?$,1>O(B)
  186. (;; Inscript-extra (4) (#, $, ^, *, ])
  187. "$,1>-=p(B" "$,1=p>-(B" "$,1=d>-=p(B" "$,1=v>-=p(B" nil)))
  188. (defvar indian-knd-base-table
  189. '(
  190. (;; VOWELS
  191. (?$,1>e(B nil) (?$,1>f(B ?$,1?>(B) (?$,1>g(B ?$,1??(B) (?$,1>h(B ?$,1?@(B) (?$,1>i(B ?$,1?A(B) (?$,1>j(B ?$,1?B(B)
  192. (?$,1>k(B ?$,1?C(B) (?$,1>l(B nil) nil (?$,1>o(B ?$,1?G(B) (?$,1>n(B ?$,1?F(B) (?$,1>p(B ?$,1?H(B)
  193. nil (?$,1>s(B ?$,1?K(B) (?$,1>r(B ?$,1?J(B) (?$,1>t(B ?$,1?L(B) (?$,1?`(B ?$,1?D(B) (?$,1?a(B nil))
  194. (;; CONSONANTS
  195. ?$,1>u(B ?$,1>v(B ?$,1>w(B ?$,1>x(B ?$,1>y(B ;; GUTTRULS
  196. ?$,1>z(B ?$,1>{(B ?$,1>|(B ?$,1>}(B ?$,1>~(B ;; PALATALS
  197. ?$,1>(B ?$,1? (B ?$,1?!(B ?$,1?"(B ?$,1?#(B ;; CEREBRALS
  198. ?$,1?$(B ?$,1?%(B ?$,1?&(B ?$,1?'(B ?$,1?((B nil ;; DENTALS
  199. ?$,1?*(B ?$,1?+(B ?$,1?,(B ?$,1?-(B ?$,1?.(B ;; LABIALS
  200. ?$,1?/(B ?$,1?0(B ?$,1?1(B ?$,1?2(B ?$,1?3(B nil ?$,1?5(B ;; SEMIVOWELS
  201. ?$,1?6(B ?$,1?7(B ?$,1?8(B ?$,1?9(B ;; SIBILANTS
  202. nil nil nil nil nil nil ?$,1?^(B nil ;; NUKTAS
  203. "$,1>|?M>~(B" "$,1>u?M?7(B")
  204. (;; Misc Symbols
  205. nil ?$,1>b(B ?$,1>c(B nil ?$,1?M(B nil nil)
  206. (;; Digits
  207. ?$,1?f(B ?$,1?g(B ?$,1?h(B ?$,1?i(B ?$,1?j(B ?$,1?k(B ?$,1?l(B ?$,1?m(B ?$,1?n(B ?$,1?o(B)
  208. (;; Inscript-extra (4) (#, $, ^, *, ])
  209. "$,1?M?0(B" "$,1?0?M(B" "$,1?$?M?0(B" "$,1?6?M?0(B" nil)))
  210. (defvar indian-mlm-base-table
  211. '(
  212. (;; VOWELS
  213. (?$,1@%(B nil) (?$,1@&(B ?$,1@^(B) (?$,1@'(B ?$,1@_(B) (?$,1@((B ?$,1@`(B) (?$,1@)(B ?$,1@a(B) (?$,1@*(B ?$,1@b(B)
  214. (?$,1@+(B ?$,1@c(B) (?$,1@,(B nil) nil (?$,1@/(B ?$,1@g(B) (?$,1@.(B ?$,1@f(B) (?$,1@0(B ?$,1@h(B)
  215. nil (?$,1@3(B ?$,1@k(B) (?$,1@2(B ?$,1@j(B) (?$,1@4(B ?$,1@l(B) nil nil)
  216. (;; CONSONANTS
  217. ?$,1@5(B ?$,1@6(B ?$,1@7(B ?$,1@8(B ?$,1@9(B ;; GUTTRULS
  218. ?$,1@:(B ?$,1@;(B ?$,1@<(B ?$,1@=(B ?$,1@>(B ;; PALATALS
  219. ?$,1@?(B ?$,1@@(B ?$,1@A(B ?$,1@B(B ?$,1@C(B ;; CEREBRALS
  220. ?$,1@D(B ?$,1@E(B ?$,1@F(B ?$,1@G(B ?$,1@H(B nil ;; DENTALS
  221. ?$,1@J(B ?$,1@K(B ?$,1@L(B ?$,1@M(B ?$,1@N(B ;; LABIALS
  222. ?$,1@O(B ?$,1@P(B ?$,1@Q(B ?$,1@R(B ?$,1@S(B ?$,1@T(B ?$,1@U(B ;; SEMIVOWELS
  223. ?$,1@V(B ?$,1@W(B ?$,1@X(B ?$,1@Y(B ;; SIBILANTS
  224. nil nil nil nil nil nil nil nil ;; NUKTAS
  225. "$,1@<@m@>(B" "$,1@5@m@W(B")
  226. (;; Misc Symbols
  227. nil ?$,1@"(B ?$,1@#(B nil ?$,1@m(B nil nil)
  228. (;; Digits
  229. ?$,1A&(B ?$,1A'(B ?$,1A((B ?$,1A)(B ?$,1A*(B ?$,1A+(B ?$,1A,(B ?$,1A-(B ?$,1A.(B ?$,1A/(B)
  230. (;; Inscript-extra (4) (#, $, ^, *, ])
  231. "$,1@m@P(B" "$,1@P@m(B" "$,1@D@m@P(B" "$,1@V@m@P(B" nil)))
  232. (defvar indian-tml-base-table
  233. '(
  234. (;; VOWELS
  235. (?$,1<%(B nil) (?$,1<&(B ?$,1<^(B) (?$,1<'(B ?$,1<_(B) (?$,1<((B ?$,1<`(B) (?$,1<)(B ?$,1<a(B) (?$,1<*(B ?$,1<b(B)
  236. nil nil nil (?$,1</(B ?$,1<g(B) (?$,1<.(B ?$,1<f(B) (?$,1<0(B ?$,1<h(B)
  237. nil (?$,1<3(B ?$,1<k(B) (?$,1<2(B ?$,1<j(B) (?$,1<4(B ?$,1<l(B) nil nil)
  238. (;; CONSONANTS
  239. ?$,1<5(B nil nil nil ?$,1<9(B ;; GUTTRULS
  240. ?$,1<:(B nil ?$,1<<(B nil ?$,1<>(B ;; PALATALS
  241. ?$,1<?(B nil nil nil ?$,1<C(B ;; CEREBRALS
  242. ?$,1<D(B nil nil nil ?$,1<H(B ?$,1<I(B ;; DENTALS
  243. ?$,1<J(B nil nil nil ?$,1<N(B ;; LABIALS
  244. ?$,1<O(B ?$,1<P(B ?$,1<Q(B ?$,1<R(B ?$,1<S(B ?$,1<T(B ?$,1<U(B ;; SEMIVOWELS
  245. nil ?$,1<W(B ?$,1<X(B ?$,1<Y(B ;; SIBILANTS
  246. nil nil nil nil nil nil nil nil ;; NUKTAS
  247. "$,1<<<m<>(B" "$,1<5<m<W(B")
  248. (;; Misc Symbols
  249. nil ?$,1<"(B ?$,1<#(B nil ?$,1<m(B nil nil)
  250. (;; Digits
  251. ?$,1=&(B ?$,1='(B ?$,1=((B ?$,1=)(B ?$,1=*(B ?$,1=+(B ?$,1=,(B ?$,1=-(B ?$,1=.(B ?$,1=/(B)
  252. (;; Inscript-extra (4) (#, $, ^, *, ])
  253. "$,1<m<P(B" "$,1<P<m(B" "$,1<D<m<P(B" nil nil)))
  254. (defvar indian-base-table-to-language-alist
  255. '((indian-dev-base-table . "Devanagari")
  256. (indian-pnj-base-table . "Punjabi")
  257. (indian-ori-base-table . "Oriya")
  258. (indian-bng-base-table . "Bengali")
  259. (indian-asm-base-table . "Assamese")
  260. (indian-tlg-base-table . "Telugu")
  261. (indian-knd-base-table . "Kannada")
  262. (indian-mlm-base-table . "Malayalam")
  263. (indian-tml-base-table . "Tamil")))
  264. (defvar indian-itrans-v5-table
  265. '(;; for encode/decode
  266. (;; vowels -- 18
  267. "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
  268. ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai"
  269. "o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I"))
  270. (;; consonants -- 40
  271. "k" "kh" "g" "gh" ("~N" "N^")
  272. "ch" ("Ch" "chh") "j" "jh" ("~n" "JN")
  273. "T" "Th" "D" "Dh" "N"
  274. "t" "th" "d" "dh" "n" "nh"
  275. "p" "ph" "b" "bh" "m"
  276. "y" "r" "rh" "l" ("L" "ld") nil ("v" "w")
  277. "sh" ("Sh" "shh") "s" "h"
  278. "q" "K" "G" ("J" "z") ".D" ".Dh" "f" ("Y" "yh")
  279. ("GY" "dny") "x")
  280. (;; misc -- 7
  281. ".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") "..")))
  282. (defvar indian-itrans-v5-table-for-tamil
  283. '(;; for encode/decode
  284. (;; vowels -- 18
  285. "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
  286. ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai"
  287. "o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I"))
  288. (;; consonants -- 40
  289. "k" "kh" "g" "gh" ("~N" "N^")
  290. "ch" ("Ch" "chh") "j" "jh" ("~n" "JN")
  291. "T" "Th" "D" "Dh" "N"
  292. "t" "th" "d" "dh" "n" "nh"
  293. "p" "ph" "b" "bh" "m"
  294. "y" "r" "rh" "l" ("L" "ld") ("J" "z") ("v" "w")
  295. "sh" ("Sh" "shh") "s" "h"
  296. "q" "K" "G" nil ".D" ".Dh" "f" ("Y" "yh")
  297. ("GY" "dny") "x")
  298. (;; misc -- 7
  299. ".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") "..")))
  300. (defvar indian-kyoto-harvard-table
  301. '(;; for encode/decode
  302. (;; vowel
  303. "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
  304. "R" ("L" "lR") nil nil "e" "ai"
  305. nil nil "o" "au" ("q" "RR" "Q") ("E" "LL" "lRR"))
  306. (;; consonant
  307. "k" "kh" "g" "gh" "G"
  308. "c" "ch" "j" "jh" "J"
  309. "T" "Th" "D" "Dh" "N"
  310. "t" "th" "d" "dh" "n" nil
  311. "p" "ph" "b" "bh" "m"
  312. "y" "r" nil "l" "L" nil "v"
  313. ("z" "Z") "S" "s" "h"
  314. nil nil nil nil nil nil nil nil
  315. nil nil)
  316. (;; misc
  317. nil "M" "H" "'" nil "." nil)))
  318. (defvar indian-harvard-table
  319. '(;; for encode/decode
  320. (;; vowel
  321. "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
  322. "R" ("L" "lR") nil nil "e" "ai"
  323. nil nil "o" "au" ("RR" "q" "Q") ("LL" "E" "lRR"))
  324. (;; consonant
  325. "k" "kh" "g" "gh" "G"
  326. "c" "ch" "j" "jh" "J"
  327. "T" "Th" "D" "Dh" "N"
  328. "t" "th" "d" "dh" "n" nil
  329. "p" "ph" "b" "bh" "m"
  330. "y" "r" nil "l" "L" nil "v"
  331. ("z" "Z") "S" "s" "h"
  332. nil nil nil nil nil nil nil nil
  333. nil nil)
  334. (;; misc
  335. nil "M" "H" "'" nil "." nil)))
  336. (defvar indian-tokyo-table
  337. '(;; for encode/decode
  338. (;; vowel
  339. "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
  340. "R" ("L" "lR") nil nil "e" "ai"
  341. nil nil "o" "au" ("Q" "RR" "q") ("E" "LL" "lRR"))
  342. (;; consonant
  343. "k" "kh" "g" "gh" "G"
  344. "c" "ch" "j" "jh" "J"
  345. "T" "Th" "D" "Dh" "N"
  346. "t" "th" "d" "dh" "n" nil
  347. "p" "ph" "b" "bh" "m"
  348. "y" "r" nil "l" "L" nil "v"
  349. ("Z" "z") "S" "s" "h"
  350. nil nil nil nil nil nil nil nil
  351. nil nil)
  352. (;; misc
  353. nil "M" "H" "'" nil "." nil)))
  354. (defvar indian-aiba-table
  355. '(;; for encode/decode
  356. (;; vowel
  357. "a" "aa" "i" "ii" "u" "uu"
  358. ".r" ".l" nil nil "e" "ai"
  359. nil nil "o" "au" "~r" "~l")
  360. (;; consonant
  361. "k" "kh" "g" "gh" "^n"
  362. "c" "ch" "j" "jh" "~n"
  363. ".t" ".th" ".d" ".dh" ".n"
  364. "t" "th" "d" "dh" "n" nil
  365. "p" "ph" "b" "bh" "m"
  366. "y" "r" nil "l" nil nil "v"
  367. "^s" ".s" "s" "h"
  368. nil nil nil nil nil nil nil nil
  369. nil nil)
  370. (;; misc
  371. nil ".m" ".h" "'" nil "." nil)))
  372. (defun combinatorial (head &rest tail)
  373. (if tail
  374. (apply 'append
  375. (mapcar (lambda (y) (mapcar (lambda (x) (cons x y)) head))
  376. (apply 'combinatorial tail)))
  377. (mapcar 'list head)))
  378. (defun indian--puthash-char (char trans-char hashtbls)
  379. (let ((encode-hash (car hashtbls)) ;; char -> trans
  380. (decode-hash (cdr hashtbls)) ;; trans -> char
  381. )
  382. ;; char -- nil / char / string (/ list of vowel & matra)
  383. ;; trans-char -- nil / string / list of strings
  384. (when (and char trans-char)
  385. (if (stringp trans-char) (setq trans-char (list trans-char)))
  386. (if (characterp char) (setq char (char-to-string char)))
  387. (puthash char (car trans-char) encode-hash)
  388. (dolist (trans trans-char)
  389. (puthash trans char decode-hash)))))
  390. (defun indian--map (f l1 l2)
  391. (while l1
  392. (funcall f (pop l1) (pop l2))))
  393. (defun indian--puthash-v (v trans-v hashtbls)
  394. (indian--map
  395. (lambda (v trans-v)
  396. (indian--puthash-char (car v) trans-v hashtbls))
  397. v trans-v))
  398. (defun indian--puthash-c (c trans-c halant hashtbls)
  399. (indian--map
  400. (lambda (c trans-c)
  401. (if (characterp c) (setq c (char-to-string c)))
  402. (indian--puthash-char (concat c halant) trans-c hashtbls))
  403. c trans-c))
  404. (defun indian--puthash-m (m trans-m hashtbls)
  405. (indian--map
  406. (lambda (m trans-m)
  407. (indian--puthash-char m trans-m hashtbls))
  408. m trans-m))
  409. (defun indian--puthash-cv (c trans-c v trans-v hashtbls)
  410. (indian--map
  411. (lambda (c trans-c)
  412. (indian--map
  413. (lambda (v trans-v)
  414. (when (and c trans-c v trans-v)
  415. (if (characterp c) (setq c (char-to-string c)))
  416. (setq v (if (characterp (cadr v)) (char-to-string (cadr v)) ""))
  417. (if (stringp trans-c) (setq trans-c (list trans-c)))
  418. (if (stringp trans-v) (setq trans-v (list trans-v)))
  419. (indian--puthash-char
  420. (concat c v)
  421. (mapcar (lambda (x) (apply 'concat x))
  422. (combinatorial trans-c trans-v))
  423. hashtbls)))
  424. v trans-v))
  425. c trans-c))
  426. (defun indian-make-hash (table trans-table)
  427. "Indian Transliteration Hash for decode/encode"
  428. (let* ((encode-hash (make-hash-table :test 'equal))
  429. (decode-hash (make-hash-table :test 'equal))
  430. (hashtbls (cons encode-hash decode-hash))
  431. (vowels (elt table 0))
  432. (consonants (elt table 1))
  433. (misc (elt table 2))
  434. (digits (elt table 3))
  435. (halant (char-to-string (elt misc 4)))
  436. (trans-vowels (elt trans-table 0))
  437. (trans-consonants (elt trans-table 1))
  438. (trans-misc (elt trans-table 2))
  439. (trans-digits '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")))
  440. (indian--puthash-v vowels trans-vowels hashtbls)
  441. (indian--puthash-c consonants trans-consonants halant hashtbls)
  442. (indian--puthash-cv consonants trans-consonants
  443. vowels trans-vowels hashtbls)
  444. (indian--puthash-m misc trans-misc hashtbls)
  445. (indian--puthash-m digits trans-digits hashtbls)
  446. hashtbls))
  447. (defvar indian-dev-itrans-v5-hash
  448. (indian-make-hash indian-dev-base-table
  449. indian-itrans-v5-table))
  450. (defvar indian-dev-kyoto-harvard-hash
  451. (indian-make-hash indian-dev-base-table
  452. indian-kyoto-harvard-table))
  453. (defvar indian-dev-aiba-hash
  454. (indian-make-hash indian-dev-base-table
  455. indian-aiba-table))
  456. (defvar indian-pnj-itrans-v5-hash
  457. (indian-make-hash indian-pnj-base-table
  458. indian-itrans-v5-table))
  459. (defvar indian-gjr-itrans-v5-hash
  460. (indian-make-hash indian-gjr-base-table
  461. indian-itrans-v5-table))
  462. (defvar indian-ori-itrans-v5-hash
  463. (indian-make-hash indian-ori-base-table
  464. indian-itrans-v5-table))
  465. (defvar indian-bng-itrans-v5-hash
  466. (indian-make-hash indian-bng-base-table
  467. indian-itrans-v5-table))
  468. (defvar indian-asm-itrans-v5-hash
  469. (indian-make-hash indian-asm-base-table
  470. indian-itrans-v5-table))
  471. (defvar indian-tlg-itrans-v5-hash
  472. (indian-make-hash indian-tlg-base-table
  473. indian-itrans-v5-table))
  474. (defvar indian-knd-itrans-v5-hash
  475. (indian-make-hash indian-knd-base-table
  476. indian-itrans-v5-table))
  477. (defvar indian-mlm-itrans-v5-hash
  478. (indian-make-hash indian-mlm-base-table
  479. indian-itrans-v5-table))
  480. (defvar indian-tml-itrans-v5-hash
  481. (indian-make-hash indian-tml-base-table
  482. indian-itrans-v5-table-for-tamil))
  483. )
  484. (defmacro indian-translate-region (from to hashtable encode-p)
  485. `(save-excursion
  486. (save-restriction
  487. (let ((regexp ,(indian-regexp-of-hashtbl-keys
  488. (if encode-p (car (eval hashtable))
  489. (cdr (eval hashtable))))))
  490. (narrow-to-region from to)
  491. (goto-char (point-min))
  492. (while (re-search-forward regexp nil t)
  493. (let ((matchstr (gethash (match-string 0)
  494. (if ,encode-p
  495. (car ,hashtable)
  496. (cdr ,hashtable)))))
  497. (if matchstr (replace-match matchstr))))))))
  498. ;;;
  499. (defun indian-dev-itrans-v5-encode-region (from to)
  500. (interactive "r")
  501. (indian-translate-region
  502. from to indian-dev-itrans-v5-hash t))
  503. (defun indian-dev-itrans-v5-decode-region (from to)
  504. (interactive "r")
  505. (indian-translate-region
  506. from to indian-dev-itrans-v5-hash nil))
  507. (defun indian-dev-kyoto-harvard-encode-region (from to)
  508. (interactive "r")
  509. (indian-translate-region
  510. from to indian-dev-kyoto-harvard-hash t))
  511. (defun indian-dev-kyoto-harvard-decode-region (from to)
  512. (interactive "r")
  513. (indian-translate-region
  514. from to indian-dev-kyoto-harvard-hash nil))
  515. (defun indian-dev-aiba-encode-region (from to)
  516. (interactive "r")
  517. (indian-translate-region
  518. from to indian-dev-aiba-hash t))
  519. (defun indian-dev-aiba-decode-region (from to)
  520. (interactive "r")
  521. (indian-translate-region
  522. from to indian-dev-aiba-hash nil))
  523. ;;; IS 13194 utilities
  524. ;; The followings provide conversion between IS 13194 (ISCII) and UCS.
  525. (let
  526. ;;Unicode vs IS13194 ;; only Devanagari is supported now.
  527. ((ucs-devanagari-to-is13194-alist
  528. '((?\x0900 . "[U+0900]")
  529. (?\x0901 . "(5!(B")
  530. (?\x0902 . "(5"(B")
  531. (?\x0903 . "(5#(B")
  532. (?\x0904 . "[U+0904]")
  533. (?\x0905 . "(5$(B")
  534. (?\x0906 . "(5%(B")
  535. (?\x0907 . "(5&(B")
  536. (?\x0908 . "(5'(B")
  537. (?\x0909 . "(5((B")
  538. (?\x090a . "(5)(B")
  539. (?\x090b . "(5*(B")
  540. (?\x090c . "(5&i(B")
  541. (?\x090d . "(5.(B")
  542. (?\x090e . "(5+(B")
  543. (?\x090f . "(5,(B")
  544. (?\x0910 . "(5-(B")
  545. (?\x0911 . "(52(B")
  546. (?\x0912 . "(5/(B")
  547. (?\x0913 . "(50(B")
  548. (?\x0914 . "(51(B")
  549. (?\x0915 . "(53(B")
  550. (?\x0916 . "(54(B")
  551. (?\x0917 . "(55(B")
  552. (?\x0918 . "(56(B")
  553. (?\x0919 . "(57(B")
  554. (?\x091a . "(58(B")
  555. (?\x091b . "(59(B")
  556. (?\x091c . "(5:(B")
  557. (?\x091d . "(5;(B")
  558. (?\x091e . "(5<(B")
  559. (?\x091f . "(5=(B")
  560. (?\x0920 . "(5>(B")
  561. (?\x0921 . "(5?(B")
  562. (?\x0922 . "(5@(B")
  563. (?\x0923 . "(5A(B")
  564. (?\x0924 . "(5B(B")
  565. (?\x0925 . "(5C(B")
  566. (?\x0926 . "(5D(B")
  567. (?\x0927 . "(5E(B")
  568. (?\x0928 . "(5F(B")
  569. (?\x0929 . "(5G(B")
  570. (?\x092a . "(5H(B")
  571. (?\x092b . "(5I(B")
  572. (?\x092c . "(5J(B")
  573. (?\x092d . "(5K(B")
  574. (?\x092e . "(5L(B")
  575. (?\x092f . "(5M(B")
  576. (?\x0930 . "(5O(B")
  577. (?\x0931 . "(5P(B")
  578. (?\x0932 . "(5Q(B")
  579. (?\x0933 . "(5R(B")
  580. (?\x0934 . "(5S(B")
  581. (?\x0935 . "(5T(B")
  582. (?\x0936 . "(5U(B")
  583. (?\x0937 . "(5V(B")
  584. (?\x0938 . "(5W(B")
  585. (?\x0939 . "(5X(B")
  586. (?\x093a . "[U+093a]")
  587. (?\x093b . "[U+093b]")
  588. (?\x093c . "(5i(B")
  589. (?\x093d . "(5ji(B")
  590. (?\x093e . "(5Z(B")
  591. (?\x093f . "(5[(B")
  592. (?\x0940 . "(5\(B")
  593. (?\x0941 . "(5](B")
  594. (?\x0942 . "(5^(B")
  595. (?\x0943 . "(5_(B")
  596. (?\x0944 . "(5_i(B")
  597. (?\x0945 . "(5c(B")
  598. (?\x0946 . "(5`(B")
  599. (?\x0947 . "(5a(B")
  600. (?\x0948 . "(5b(B")
  601. (?\x0949 . "(5g(B")
  602. (?\x094a . "(5d(B")
  603. (?\x094b . "(5e(B")
  604. (?\x094c . "(5f(B")
  605. (?\x094d . "(5h(B")
  606. (?\x094e . "[U+094e]")
  607. (?\x094f . "[U+094f]")
  608. (?\x0950 . "(5!i(B")
  609. (?\x0951 . "(5p5(B")
  610. (?\x0952 . "(5p8(B")
  611. (?\x0953 . "[DEVANAGARI GRAVE ACCENT]")
  612. (?\x0954 . "[DEVANAGARI ACUTE ACCENT]")
  613. (?\x0955 . "[U+0955]")
  614. (?\x0956 . "[U+0956]")
  615. (?\x0957 . "[U+0957]")
  616. (?\x0958 . "(53i(B")
  617. (?\x0959 . "(54i(B")
  618. (?\x095a . "(55i(B")
  619. (?\x095b . "(5:i(B")
  620. (?\x095c . "(5?i(B")
  621. (?\x095d . "(5@i(B")
  622. (?\x095e . "(5Ii(B")
  623. (?\x095f . "(5N(B")
  624. (?\x0960 . "(5*i(B")
  625. (?\x0961 . "(5'i(B")
  626. (?\x0962 . "(5[i(B")
  627. (?\x0963 . "(5ei(B")
  628. (?\x0964 . "(5j(B")
  629. (?\x0965 . "(5jj(B")
  630. (?\x0966 . "(5q(B")
  631. (?\x0967 . "(5r(B")
  632. (?\x0968 . "(5s(B")
  633. (?\x0969 . "(5t(B")
  634. (?\x096a . "(5u(B")
  635. (?\x096b . "(5v(B")
  636. (?\x096c . "(5w(B")
  637. (?\x096d . "(5x(B")
  638. (?\x096e . "(5y(B")
  639. (?\x096f . "(5z(B")
  640. (?\x0970 . "[U+0970]")
  641. (?\x0971 . "[U+0971]")
  642. (?\x0972 . "[U+0972]")
  643. (?\x0973 . "[U+0973]")
  644. (?\x0974 . "[U+0974]")
  645. (?\x0975 . "[U+0975]")
  646. (?\x0976 . "[U+0976]")
  647. (?\x0977 . "[U+0977]")
  648. (?\x0978 . "[U+0978]")
  649. (?\x0979 . "[U+0979]")
  650. (?\x097a . "[U+097a]")
  651. (?\x097b . "[U+097b]")
  652. (?\x097c . "[U+097c]")
  653. (?\x097d . "[U+097d]")
  654. (?\x097e . "[U+097e]")
  655. (?\x097f . "[U+097f]")))
  656. (ucs-bengali-to-is13194-alist nil)
  657. (ucs-assamese-to-is13194-alist nil)
  658. (ucs-gurmukhi-to-is13194-alist nil)
  659. (ucs-gujarati-to-is13194-alist nil)
  660. (ucs-oriya-to-is13194-alist nil)
  661. (ucs-tamil-to-is13194-alist nil)
  662. (ucs-telugu-to-is13194-alist nil)
  663. (ucs-malayalam-to-is13194-alist nil)
  664. (ucs-kannada-to-is13194-alist nil))
  665. (dolist (script '(devanagari bengali assamese gurmukhi gujarati
  666. oriya tamil telugu malayalam kannada))
  667. (let ((hashtable (intern (concat "is13194-to-ucs-"
  668. (symbol-name script) "-hashtbl" )))
  669. (regexp (intern (concat "is13194-to-ucs-"
  670. (symbol-name script) "-regexp"))))
  671. (set hashtable (make-hash-table :test 'equal :size 128))
  672. (dolist (x (eval (intern (concat "ucs-" (symbol-name script)
  673. "-to-is13194-alist"))))
  674. (put-char-code-property (car x) 'script script)
  675. (put-char-code-property (car x) 'iscii (cdr x))
  676. (puthash (cdr x) (char-to-string (car x)) (eval hashtable)))
  677. (set regexp (indian-regexp-of-hashtbl-keys (eval hashtable))))))
  678. (defvar is13194-default-repertory 'devanagari)
  679. (defvar is13194-repertory-to-ucs-script
  680. `((DEF ?\x40 ,is13194-default-repertory)
  681. (RMN ?\x41 ,is13194-default-repertory)
  682. (DEV ?\x42 devanagari)
  683. (BNG ?\x43 bengali)
  684. (TML ?\x44 tamil)
  685. (TLG ?\x45 telugu)
  686. (ASM ?\x46 bengali)
  687. (ORI ?\x47 oriya)
  688. (KND ?\x48 kannada)
  689. (MLM ?\x49 malayalam)
  690. (GJR ?\x4a gujarati)
  691. (PNJ ?\x4b gurmukhi)))
  692. ;; for guiding find-variable function.
  693. (defvar is13194-to-ucs-devanagari-hashtbl nil)
  694. (defvar is13194-to-ucs-devanagari-regexp nil)
  695. (defvar is13194-to-ucs-bengali-hashtbl nil)
  696. (defvar is13194-to-ucs-bengali-regexp nil)
  697. (defvar is13194-to-ucs-assamese-hashtbl nil)
  698. (defvar is13194-to-ucs-assamese-regexp nil)
  699. (defvar is13194-to-ucs-gurmukhi-hashtbl nil)
  700. (defvar is13194-to-ucs-gurmukhi-regexp nil)
  701. (defvar is13194-to-ucs-gujarati-hashtbl nil)
  702. (defvar is13194-to-ucs-gujarati-regexp nil)
  703. (defvar is13194-to-ucs-oriya-hashtbl nil)
  704. (defvar is13194-to-ucs-oriya-regexp nil)
  705. (defvar is13194-to-ucs-tamil-hashtbl nil)
  706. (defvar is13194-to-ucs-tamil-regexp nil)
  707. (defvar is13194-to-ucs-telugu-hashtbl nil)
  708. (defvar is13194-to-ucs-telugu-regexp nil)
  709. (defvar is13194-to-ucs-malayalam-hashtbl nil)
  710. (defvar is13194-to-ucs-malayalam-regexp nil)
  711. (defvar is13194-to-ucs-kannada-hashtbl nil)
  712. (defvar is13194-to-ucs-kannada-regexp nil)
  713. (defvar ucs-to-is13194-regexp
  714. ;; only Devanagari is supported now.
  715. (concat "[" (char-to-string #x0900)
  716. "-" (char-to-string #x097f) "]")
  717. "Regexp that matches to conversion")
  718. (defun ucs-to-iscii-region (from to)
  719. "Converts the indian UCS characters in the region to ISCII.
  720. Returns new end position."
  721. (interactive "r")
  722. ;; only Devanagari is supported now.
  723. (save-excursion
  724. (save-restriction
  725. (narrow-to-region from to)
  726. (goto-char (point-min))
  727. (let* ((current-repertory is13194-default-repertory))
  728. (while (re-search-forward ucs-to-is13194-regexp nil t)
  729. (replace-match
  730. (get-char-code-property (string-to-char (match-string 0))
  731. 'iscii))))
  732. (point-max))))
  733. (defun iscii-to-ucs-region (from to)
  734. "Converts the ISCII characters in the region to UCS.
  735. Returns new end position."
  736. (interactive "r")
  737. ;; only Devanagari is supported now.
  738. (save-excursion
  739. (save-restriction
  740. (narrow-to-region from to)
  741. (goto-char (point-min))
  742. (let* ((current-repertory is13194-default-repertory)
  743. (current-hashtable
  744. (intern (concat "is13194-to-ucs-"
  745. (symbol-name current-repertory) "-hashtbl")))
  746. (current-regexp
  747. (intern (concat "is13194-to-ucs-"
  748. (symbol-name current-repertory) "-regexp")))
  749. (re (eval current-regexp))
  750. (hash (eval current-hashtable)))
  751. (while (re-search-forward re nil t)
  752. (replace-match (gethash (match-string 0) hash ""))))
  753. (point-max))))
  754. ;;;###autoload
  755. (defun indian-compose-region (from to)
  756. "Compose the region according to `composition-function-table'."
  757. (interactive "r")
  758. (save-excursion
  759. (save-restriction
  760. (let ((pos from) newpos func (max to))
  761. (narrow-to-region from to)
  762. (while (< pos max)
  763. (setq func (aref composition-function-table (char-after pos)))
  764. (if (fboundp func)
  765. (setq newpos (funcall func pos nil)
  766. pos (if (and (integerp newpos) (> newpos pos))
  767. newpos (1+ pos)))
  768. (setq pos (1+ pos))))))))
  769. ;;;###autoload
  770. (defun indian-compose-string (string)
  771. (with-temp-buffer
  772. (insert string)
  773. (indian-compose-region (point-min) (point-max))
  774. (buffer-string)))
  775. ;;;###autoload
  776. (defun in-is13194-post-read-conversion (len)
  777. (let ((pos (point)) endpos)
  778. (setq endpos (iscii-to-ucs-region pos (+ pos len)))
  779. (- endpos pos)))
  780. ;;;###autoload
  781. (defun in-is13194-pre-write-conversion (from to)
  782. (let ((buf (current-buffer)))
  783. (set-buffer (generate-new-buffer " *temp*"))
  784. (if (stringp from)
  785. (insert from)
  786. (insert-buffer-substring buf from to))
  787. (ucs-to-iscii-region (point-min) (point-max))
  788. nil))
  789. ;;; Backward Compatibility support programs
  790. ;; The following provides the conversion from old-implementation of
  791. ;; Emacs Devanagari script to UCS.
  792. (defconst indian-2-colum-to-ucs
  793. '(
  794. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  795. ;;2120 $(6!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/(B
  796. ("$(6!!(B" . "$,15A(B")
  797. ("$(6!"(B" . "$,15B(B")
  798. ("$(6!#(B" . "$,15C(B")
  799. ("$(6!$(B" . "$,15E(B")
  800. ("$(6!%(B" . "$,15F(B")
  801. ("$(6!&(B" . "$,15G(B")
  802. ("$(6!'(B" . "$,15H(B")
  803. ("$(6!((B" . "$,15I(B")
  804. ("$(6!)(B" . "$,15J(B")
  805. ("$(6!*(B" . "$,15K(B")
  806. ("$(6!*"p(B" . "$,15p6#(B")
  807. ("$(6!+(B" . "$,15N(B")
  808. ("$(6!,(B" . "$,15O(B")
  809. ("$(6!-(B" . "$,15P(B")
  810. ("$(6!.(B" . "$,15M(B")
  811. ("$(6!/(B" . "$,15R(B")
  812. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  813. ;;2130 $(6!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B
  814. ("$(6!0(B" . "$,15S(B")
  815. ("$(6!1(B" . "$,15T(B")
  816. ("$(6!2(B" . "$,15Q(B")
  817. ("$(6!3(B" . "$,15U(B")
  818. ("$(6!4(B" . "$,15V(B")
  819. ("$(6!5(B" . "$,15W(B")
  820. ("$(6!6(B" . "$,15X(B")
  821. ("$(6!7(B" . "$,15Y(B")
  822. ("$(6!8(B" . "$,15Z(B")
  823. ("$(6!9(B" . "$,15[(B")
  824. ("$(6!:(B" . "$,15\(B")
  825. ("$(6!;(B" . "$,15](B")
  826. ("$(6!<(B" . "$,15^(B")
  827. ("$(6!=(B" . "$,15_(B")
  828. ("$(6!>(B" . "$,15`(B")
  829. ("$(6!?(B" . "$,15a(B")
  830. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  831. ;;2140 $(6!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B
  832. ("$(6!@(B" . "$,15b(B")
  833. ("$(6!A(B" . "$,15c(B")
  834. ("$(6!B(B" . "$,15d(B")
  835. ("$(6!C(B" . "$,15e(B")
  836. ("$(6!D(B" . "$,15f(B")
  837. ("$(6!E(B" . "$,15g(B")
  838. ("$(6!F(B" . "$,15h(B")
  839. ("$(6!G(B" . "$,15i(B")
  840. ("$(6!H(B" . "$,15j(B")
  841. ("$(6!I(B" . "$,15k(B")
  842. ("$(6!J(B" . "$,15l(B")
  843. ("$(6!K(B" . "$,15m(B")
  844. ("$(6!L(B" . "$,15n(B")
  845. ("$(6!M(B" . "$,15o(B")
  846. ("$(6!N(B" . "$,16?(B")
  847. ("$(6!O(B" . "$,15p(B")
  848. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  849. ;;2150 $(6!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B
  850. ("$(6!P(B" . "$,15q(B")
  851. ("$(6!Q(B" . "$,15r(B")
  852. ("$(6!R(B" . "$,15s(B")
  853. ("$(6!S(B" . "$,15t(B")
  854. ("$(6!T(B" . "$,15u(B")
  855. ("$(6!U(B" . "$,15v(B")
  856. ("$(6!V(B" . "$,15w(B")
  857. ("$(6!W(B" . "$,15x(B")
  858. ("$(6!X(B" . "$,15y(B")
  859. ("$(6!Z(B" . "$,15~(B")
  860. ("$(6![(B" . "$,15(B")
  861. ("$(6!\(B" . "$,16 (B")
  862. ("$(6!](B" . "$,16!(B")
  863. ("$(6!^(B" . "$,16"(B")
  864. ("$(6!_(B" . "$,16#(B")
  865. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  866. ;;2160 $(6!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B
  867. ("$(6!`(B" . "$,16&(B")
  868. ("$(6!a(B" . "$,16'(B")
  869. ("$(6!b(B" . "$,16((B")
  870. ("$(6!c(B" . "$,16%(B")
  871. ("$(6!d(B" . "$,16*(B")
  872. ("$(6!e(B" . "$,16+(B")
  873. ("$(6!f(B" . "$,16,(B")
  874. ("$(6!g(B" . "$,16)(B")
  875. ("$(6!h(B" . "$,16-(B")
  876. ("$(6!i(B" . "$,15|(B")
  877. ("$(6!j(B" . "$,16D(B")
  878. ("$(6!j!j(B" . "$,16E(B")
  879. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  880. ;;2170 $(6!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B
  881. ("$(6!q(B" . "$,16F(B")
  882. ("$(6!r(B" . "$,16G(B")
  883. ("$(6!s(B" . "$,16H(B")
  884. ("$(6!t(B" . "$,16I(B")
  885. ("$(6!u(B" . "$,16J(B")
  886. ("$(6!v(B" . "$,16K(B")
  887. ("$(6!w(B" . "$,16L(B")
  888. ("$(6!x(B" . "$,16M(B")
  889. ("$(6!y(B" . "$,16N(B")
  890. ("$(6!z(B" . "$,16O(B")
  891. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  892. ;;2220 $(6"!"""#"$"%"&"'"(")"*"+","-"."/(B
  893. ("$(6"!(B" . "$,16;6-5p(B")
  894. ("$(6""(B" . "$,16>6-5p(B")
  895. ("$(6"#(B" . "$,15U6-5p(B")
  896. ("$(6"$(B" . "$,15W6-5p(B")
  897. ("$(6"%(B" . "$,15d6-5p(B")
  898. ("$(6"&(B" . "$,15j6-5p(B")
  899. ("$(6"'(B" . "$,15k6-5p(B")
  900. ("$(6")(B" . "$,15v6-5p(B")
  901. ("$(6",(B" . "$,15p6!(B")
  902. ("$(6"-(B" . "$,15p6"(B")
  903. ("$(6".(B" . "$,15q6!(B")
  904. ("$(6"/(B" . "$,15q6"(B")
  905. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  906. ;;2230 $(6"0"1"2"3"4"5"6"7"8"9":";"<"=">"?(B
  907. ("$(6"3(B" . "$,15U6-(B")
  908. ("$(6"4(B" . "$,15V6-(B")
  909. ("$(6"5(B" . "$,15W6-(B")
  910. ("$(6"6(B" . "$,15X6-(B")
  911. ("$(6"8(B" . "$,15Z6-(B")
  912. ("$(6"8"q(B" . "$,15Z6-5p6-(B")
  913. ("$(6":(B" . "$,15\6-(B")
  914. ("$(6";(B" . "$,15]6-(B")
  915. ("$(6"<(B" . "$,15^6-(B")
  916. ("$(6"<(B" . "$,15^6-(B")
  917. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  918. ;;2240 $(6"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O(B
  919. ("$(6"A(B" . "$,15c6-(B")
  920. ("$(6"B(B" . "$,15d6-(B")
  921. ("$(6"C(B" . "$,15e6-(B")
  922. ("$(6"E(B" . "$,15g6-(B")
  923. ("$(6"F(B" . "$,15h6-(B")
  924. ("$(6"G(B" . "$,15i6-(B")
  925. ("$(6"H(B" . "$,15j6-(B")
  926. ("$(6"I(B" . "$,15k6-(B")
  927. ("$(6"J(B" . "$,15l6-(B")
  928. ("$(6"J(B" . "$,15l6-(B")
  929. ("$(6"K(B" . "$,15m6-(B")
  930. ("$(6"L(B" . "$,15n6-(B")
  931. ("$(6"M(B" . "$,15o6-(B")
  932. ("$(6"N(B" . "$,16?6-(B")
  933. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  934. ;;2250 $(6"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_(B
  935. ("$(6"Q(B" . "$,15r6-(B")
  936. ("$(6"R(B" . "$,15s6-(B")
  937. ("$(6"S(B" . "$,15t6-(B")
  938. ("$(6"T(B" . "$,15u6-(B")
  939. ("$(6"U(B" . "$,15v6-(B")
  940. ("$(6"V(B" . "$,15w6-(B")
  941. ("$(6"W(B" . "$,15x6-(B")
  942. ("$(6"](B" . "$,16-5o(B")
  943. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  944. ;;2260 $(6"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o(B
  945. ("$(6"`(B" . "$,15W6-5p6-(B")
  946. ("$(6"a(B" . "$,15X6-5h6-(B")
  947. ("$(6"c(B" . "$,15d6-5d6-(B")
  948. ("$(6"d(B" . "$,15d6-5p6-(B")
  949. ("$(6"e(B" . "$,15g6-5h6-(B")
  950. ("$(6"f(B" . "$,15g6-5p6-(B")
  951. ("$(6"g(B" . "$,15j6-5d6-(B")
  952. ("$(6"h(B" . "$,15v6-5Z6-(B")
  953. ("$(6"i(B" . "$,15v6-5p6-(B")
  954. ("$(6"j(B" . "$,15v6-5u6-(B")
  955. ("$(6"k(B" . "$,15h6-5h6-(B")
  956. ("$(6"l(B" . "$,15U6-5w6-(B")
  957. ("$(6"m(B" . "$,15\6-5^6-(B")
  958. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  959. ;;2270 $(6"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~(B
  960. ("$(6"p(B" . "$,15p6-(B")
  961. ("$(6"q(B" . "$,16-5p(B")
  962. ("$(6"r(B" . "$,16-5p(B")
  963. ("$(6"s(B" . "$,1686-(B")
  964. ("$(6"t(B" . "$,1696-(B")
  965. ("$(6"u(B" . "$,16:6-(B")
  966. ("$(6"y(B" . "$,16>6-(B")
  967. ("$(6"z(B" . "$,16;6-(B")
  968. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  969. ;;2320 $(6#!#"###$#%#&#'#(#)#*#+#,#-#.#/(B
  970. ("$(6#!(B" . "$,160(B")
  971. ("$(6#&(B" . "$,15L(B")
  972. ("$(6#&"p(B" . "$,15p6$(B")
  973. ("$(6#'(B" . "$,16A(B")
  974. ("$(6#'"p(B" . "$,15p6C(B")
  975. ("$(6#*(B" . "$,16@(B")
  976. ("$(6#*"p(B" . "$,15p6B(B")
  977. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  978. ;;2330 $(6#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?(B
  979. ("$(6#3(B" . "$,168(B")
  980. ("$(6#4(B" . "$,169(B")
  981. ("$(6#5(B" . "$,16:(B")
  982. ("$(6#:(B" . "$,16;(B")
  983. ("$(6#?(B" . "$,16<(B")
  984. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  985. ;;2340 $(6#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O(B
  986. ("$(6#@(B" . "$,16=(B")
  987. ("$(6#I(B" . "$,16>(B")
  988. ("$(6#J(B" . "$,15}(B")
  989. ("$(6#K(B" . "$,16$(B")
  990. ("$(6#L(B" . "$,16B(B")
  991. ("$(6#M(B" . "$,16C(B")
  992. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  993. ;;2350 $(6#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_(B
  994. ("$(6#P(B" . "$,15n6-5h(B")
  995. ("$(6#Q(B" . "$,15n6-5r(B")
  996. ("$(6#R(B" . "$,15y6#(B")
  997. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  998. ;;2360 $(6#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o(B
  999. ("$(6#`(B" . "$,15r6-5r(B")
  1000. ("$(6#a(B" . "$,15u6-5h(B")
  1001. ("$(6#b(B" . "$,15u6-5u(B")
  1002. ("$(6#c(B" . "$,15v6-5Z(B")
  1003. ("$(6#d(B" . "$,15v6-5h(B")
  1004. ("$(6#e(B" . "$,15v6-5l(B")
  1005. ("$(6#f(B" . "$,15v6-5r(B")
  1006. ("$(6#g(B" . "$,15v6-5u(B")
  1007. ("$(6#h(B" . "$,15w6-5_6-5p6-5o(B")
  1008. ("$(6#i(B" . "$,15w6-5_6-5o(B")
  1009. ("$(6#j(B" . "$,15w6-5_6-5u(B")
  1010. ("$(6#k(B" . "$,15w6-5_(B")
  1011. ("$(6#l(B" . "$,15w6-5`(B")
  1012. ("$(6#m(B" . "$,15x6-5h(B")
  1013. ("$(6#n(B" . "$,15x6-5p(B")
  1014. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1015. ;;2370 $(6#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~(B
  1016. ("$(6#p(B" . "$,15y6-5c(B")
  1017. ("$(6#q(B" . "$,15y6-5h(B")
  1018. ("$(6#r(B" . "$,15y6-5n(B")
  1019. ("$(6#s(B" . "$,15y6-5o(B")
  1020. ("$(6#t(B" . "$,15y6-5p(B")
  1021. ("$(6#u(B" . "$,15y6-5r(B")
  1022. ("$(6#v(B" . "$,15y6-5u(B")
  1023. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1024. ;;2420 $(6$!$"$#$$$%$&$'$($)$*$+$,$-$.$/(B
  1025. ("$(6$!(B" . "$,15U6-5d6-5p6-5o(B")
  1026. ("$(6$"(B" . "$,15U6-5d6-5u(B")
  1027. ("$(6$#(B" . "$,15U6-5d6-5o(B")
  1028. ("$(6$$(B" . "$,15U6-5h6-5o(B")
  1029. ("$(6$%(B" . "$,15U6-5p6-5o(B")
  1030. ("$(6$&(B" . "$,15U6-5u6-5o(B")
  1031. ("$(6$'(B" . "$,15U6-5U(B")
  1032. ("$(6$((B" . "$,15U6-5d(B")
  1033. ("$(6$)(B" . "$,15U6-5h(B")
  1034. ("$(6$*(B" . "$,15U6-5n(B")
  1035. ("$(6$+(B" . "$,15U6-5o(B")
  1036. ("$(6$,(B" . "$,15U6-5r(B")
  1037. ("$(6$-(B" . "$,15U6-5u(B")
  1038. ("$(6$.(B" . "$,15U6-5w(B")
  1039. ("$(6$/(B" . "$,15X6-5h(B")
  1040. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1041. ;;2430 $(6$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?(B
  1042. ("$(6$0(B" . "$,15Y6-5U6-5d6-5o(B")
  1043. ("$(6$1(B" . "$,15Y6-5U6-5w6-5u(B")
  1044. ("$(6$2(B" . "$,15Y6-5U6-5d(B")
  1045. ("$(6$3(B" . "$,15Y6-5U6-5w(B")
  1046. ("$(6$4(B" . "$,15Y6-5X6-5p(B")
  1047. ("$(6$5(B" . "$,15Y6-5U6-5o(B")
  1048. ("$(6$6(B" . "$,15Y6-5V6-5o(B")
  1049. ("$(6$7(B" . "$,15Y6-5W6-5o(B")
  1050. ("$(6$8(B" . "$,15Y6-5X6-5o(B")
  1051. ("$(6$9(B" . "$,15Y6-5U(B")
  1052. ("$(6$:(B" . "$,15Y6-5V(B")
  1053. ("$(6$;(B" . "$,15Y6-5W(B")
  1054. ("$(6$<(B" . "$,15Y6-5X(B")
  1055. ("$(6$=(B" . "$,15Y6-5Y(B")
  1056. ("$(6$>(B" . "$,15Y6-5h(B")
  1057. ("$(6$?(B" . "$,15Y6-5n(B")
  1058. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1059. ;;2440 $(6$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O(B
  1060. ("$(6$@(B" . "$,15Y6-5o(B")
  1061. ("$(6$A(B" . "$,15Z6-5Z(B")
  1062. ("$(6$B(B" . "$,15Z6-5^(B")
  1063. ("$(6$C(B" . "$,15[6-5o(B")
  1064. ("$(6$D(B" . "$,15\6-5p(B")
  1065. ("$(6$E(B" . "$,15\6-5^(B")
  1066. ("$(6$F(B" . "$,15^6-5Z(B")
  1067. ("$(6$G(B" . "$,15^6-5\(B")
  1068. ("$(6$H(B" . "$,15_6-5U(B")
  1069. ("$(6$I(B" . "$,15_6-5_(B")
  1070. ("$(6$J(B" . "$,15_6-5`(B")
  1071. ("$(6$K(B" . "$,15_6-5o(B")
  1072. ("$(6$L(B" . "$,15`6-5o(B")
  1073. ("$(6$M(B" . "$,15a6-5W6-5o(B")
  1074. ("$(6$N(B" . "$,15a6-5X6-5p(B")
  1075. ("$(6$O(B" . "$,15a6-5p6-5o(B")
  1076. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1077. ;;2450 $(6$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_(B
  1078. ("$(6$P(B" . "$,15a6-5W(B")
  1079. ("$(6$Q(B" . "$,15a6-5X(B")
  1080. ("$(6$R(B" . "$,15a6-5a(B")
  1081. ("$(6$S(B" . "$,15a6-5n(B")
  1082. ("$(6$T(B" . "$,15a6-5o(B")
  1083. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1084. ;;2460 $(6$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o(B
  1085. ("$(6$`(B" . "$,15b6-5o(B")
  1086. ("$(6$a(B" . "$,15d6-5d(B")
  1087. ("$(6$b(B" . "$,15d6-5h(B")
  1088. ("$(6$c(B" . "$,15f6-5f6-5o(B")
  1089. ("$(6$d(B" . "$,15f6-5g6-5o(B")
  1090. ("$(6$e(B" . "$,15f6-5m6-5o(B")
  1091. ("$(6$f(B" . "$,15f6-5p6-5o(B")
  1092. ("$(6$g(B" . "$,15f6-5u6-5o(B")
  1093. ("$(6$h(B" . "$,15f6-5W6-5p(B")
  1094. ("$(6$i(B" . "$,15f6-5X6-5p(B")
  1095. ("$(6$j(B" . "$,15f6-5f6-5u(B")
  1096. ("$(6$k(B" . "$,15f6-5g6-5u(B")
  1097. ("$(6$l(B" . "$,15f6-5W(B")
  1098. ("$(6$m(B" . "$,15f6-5X(B")
  1099. ("$(6$n(B" . "$,15f6-5f(B")
  1100. ("$(6$o(B" . "$,15f6-5g(B")
  1101. ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
  1102. ;;2470 $(6$p$q$r$s$t$u$v$w$x$y$z${$|$}$~(B
  1103. ("$(6$p(B" . "$,15f6-5h(B")
  1104. ("$(6$q(B" . "$,15f6-5l(B")
  1105. ("$(6$r(B" . "$,15f6-5m(B")
  1106. ("$(6$s(B" . "$,15f6-5n(B")
  1107. ("$(6$t(B" . "$,15f6-5o(B")
  1108. ("$(6$u(B" . "$,15f6-5u(B")
  1109. ("$(6$v(B" . "$,15g6-5h(B")
  1110. ("$(6$w(B" . "$,15h6-5h(B")
  1111. ("$(6$x(B" . "$,15j6-5d(B")
  1112. ("$(6$y(B" . "$,15j6-5h(B")
  1113. ("$(6$z(B" . "$,15j6-5r(B")
  1114. ("$(6${(B" . "$,15l6-5h(B")
  1115. ("$(6$|(B" . "$,15l6-5l(B")
  1116. ("$(6$}(B" . "$,15l6-5u(B")
  1117. ("$(6$~(B" . "$,15m6-5h(B")))
  1118. (defconst indian-2-column-to-ucs-regexp
  1119. "$(6!j!j(B\\|$(6"8"q(B\\|[$(6#&#'!*#*(B]$(6"p(B\\|[$(6!!(B-$(6$~(B]")
  1120. (put 'indian-2-column-to-ucs-chartable 'char-table-extra-slots 1)
  1121. (defconst indian-2-column-to-ucs-chartable
  1122. (let ((table (make-char-table 'indian-2-column-to-ucs-chartable))
  1123. (alist nil))
  1124. (dolist (elt indian-2-colum-to-ucs)
  1125. (if (= (length (car elt)) 1)
  1126. (aset table (aref (car elt) 0) (cdr elt))
  1127. (setq alist (cons elt alist))))
  1128. (set-char-table-extra-slot table 0 alist)
  1129. table))
  1130. ;;;###autoload
  1131. (defun indian-2-column-to-ucs-region (from to)
  1132. "Convert old Emacs Devanagari characters to UCS."
  1133. (interactive "r")
  1134. (save-excursion
  1135. (save-restriction
  1136. (let ((pos from)
  1137. (alist (char-table-extra-slot indian-2-column-to-ucs-chartable 0)))
  1138. (narrow-to-region from to)
  1139. (decompose-region from to)
  1140. (goto-char (point-min))
  1141. (while (re-search-forward indian-2-column-to-ucs-regexp nil t)
  1142. (let ((len (- (match-end 0) (match-beginning 0)))
  1143. subst)
  1144. (if (= len 1)
  1145. (setq subst (aref indian-2-column-to-ucs-chartable
  1146. (char-after (match-beginning 0))))
  1147. (setq subst (cdr (assoc (match-string 0) alist))))
  1148. (replace-match (if subst subst "?"))))
  1149. (indian-compose-region (point-min) (point-max))))))
  1150. (provide 'ind-util)
  1151. ;;; ind-util.el ends here