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