Mercurial > emacs
annotate leim/quail/devanagari.el @ 26481:70d85ae6dfee
(Fsingle_key_description): Use KEY_DESCRIPTION_SIZE to
allocate memory for push_key_description.
(describe_buffer_bindings): Likewise.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 18 Nov 1999 05:10:13 +0000 |
parents | db21a8833d0f |
children | 519983161a46 |
rev | line source |
---|---|
18673 | 1 ;; quail/devanagari.el -- Quail packages for inputting Devanagari |
2 | |
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | |
6 | |
7 ;; Keywords: multilingual, input method, Indian, Devanagari | |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;; History: | |
29 ;; 1996.10.10 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | |
30 ;; 1997.03.21 fixed by KAWABATA, Taichi | |
31 | |
32 ;; I'm not sure if this keyboard layout is REALLY an ISCII keyboard layout. | |
33 ;; Please let me know if it is not. | |
34 | |
35 ;;; Code: | |
36 | |
37 (require 'quail) | |
38 (require 'devan-util) | |
39 | |
40 ;; This function does nothing for now. For future use. | |
41 (defun quail-devanagari-update-translation (control-flag) | |
42 (cond ((eq control-flag t) ; terminate translation with the whole key. | |
43 (insert quail-current-str) | |
44 (quail-terminate-translation)) | |
45 ((null control-flag) ; proceed translation with more keys. | |
46 (insert (or quail-current-str quail-current-key))) | |
47 (t ; control-flag is the number of keys to be translated. | |
48 (insert (aref quail-current-key 0)) | |
49 (setq unread-command-events | |
50 (list (aref quail-current-key control-flag)))))) | |
51 | |
52 (defun quail-devanagari-compose-characters () | |
53 (interactive) | |
54 (if (quail-point-in-conversion-region) | |
55 (let* ((from (overlay-start quail-conv-overlay)) | |
56 (to (overlay-end quail-conv-overlay)) | |
57 (dstr (buffer-substring from to))) | |
23891
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
58 (setq overriding-terminal-local-map nil |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
59 quail-converting nil |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
60 quail-conversion-str |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
61 (concat (devanagari-compose-string dstr 'sanskrit) |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
62 (list (if (numberp last-command-char) |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
63 last-command-char |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
64 (get last-command-char 'ascii-character)))))))) |
18673 | 65 |
66 (quail-define-package | |
67 "devanagari-keyboard-a" "Devanagari" "DevK" t | |
68 "Devanagari input method with ISCII format | |
69 | |
70 `$(5!\(B !$(5!.(B @$(5!c(B #x $x %x ^x &$(5")(B *$(5"((B ( ) _$(5!#(B +$(5!*(B | |
71 ~$(5!/(B 1$(5!r(B 2$(5!s(B 3$(5!t(B 4$(5!u(B 5$(5!v(B 6$(5!w(B 7$(5!x(B 8$(5!y(B 9$(5!z(B 0$(5!q(B - =$(5!_(B | |
72 | |
73 Q$(5!f(B W$(5!-(B E$(5!%(B R$(5!'(B T$(5!)(B Y$(5!K(B U$(5!7(B I$(5!E(B O$(5!C(B P$(5!;(B {$(5!@(B }$(5!<(B |$(5!2(B | |
74 q$(5!f(B w$(5!b(B e$(5!Z(B r$(5!\(B t$(5!^(B y$(5!J(B u$(5!X(B i$(5!5(B o$(5!D(B p$(5!:(B [$(5!?(B ]$(5!i(B \\$(5!g(B | |
75 | |
76 A$(5!0(B S$(5!,(B D$(5!$(B F$(5!&(B G$(5!((B H$(5!I(B J$(5!P(B K$(5!4(B l$(5!C(B :$(5!8(B \"$(5!>(B | |
77 a$(5!e(B s$(5!a(B d$(5!h(B f$(5![(B g$(5!](B h$(5!H(B j$(5!O(B k$(5!3(B l$(5!B(B ;$(5!9(B '$(5!=(B | |
78 | |
79 Z$(5!+(B X$(5!!(B C$(5!A(B V$(5!G(B B$(5!S(B N$(5!R(B M$(5!U(B <$(5!V(B >$(5!j(B ?$(5!N(B | |
80 z$(5!`(B x$(5!"(B c$(5!L(B v$(5!F(B b$(5!T(B n$(5!Q(B m$(5!W(B , . /$(5!M(B | |
81 " | |
82 nil t t nil nil nil nil nil | |
83 ;;'quail-devanagari-update-translation | |
84 nil | |
85 '((" " . quail-devanagari-compose-characters) | |
86 ("-" . quail-devanagari-compose-characters) | |
87 ("," . quail-devanagari-compose-characters) | |
88 ("\C-m" . quail-devanagari-compose-characters) | |
89 ([return] . quail-devanagari-compose-characters)) | |
90 ) | |
91 | |
92 ;; ..... (not prepared yet) | |
93 ;; I forgot where I got this keymap from. | |
94 ;; Please let me know if you know what this keymap is. | |
95 | |
96 (quail-define-rules | |
97 ("`" ?$(5!\(B) | |
98 ("~" ?$(5!/(B) | |
99 ("1" ?$(5!r(B) | |
100 ("!" ?$(5!.(B) | |
101 ("2" ?$(5!s(B) | |
102 ("@" ?$(5!c(B) | |
103 ("3" ?$(5!t(B) | |
104 ("#" ?# ) ; following "r" in keymap... | |
105 ("4" ?$(5!u(B) | |
106 ("$" ?$ ) ; preceding "r" in keymap... | |
107 ("5" ?$(5!v(B) | |
108 ("%" ?x ) ; ?? | |
109 ("6" ?$(5!w(B) | |
110 ("^" ?x ) ; %tra | |
111 ("7" ?$(5!x(B) | |
112 ("&" ?$(5")(B) ; % special | |
113 ("8" ?$(5!y(B) | |
114 ("*" ?$(5"((B) ; % special | |
115 ("9" ?$(5!z(B) | |
116 ("(" ?\() | |
117 ("0" ?$(5!q(B) | |
118 (")" ?\)) | |
119 ("-" ?-) | |
120 ("_" ?$(5!#(B) | |
121 ("=" ?$(5!_(B) | |
122 ("+" ?$(5!*(B) | |
123 ("q" ?$(5!f(B) | |
124 ("Q" ?$(5!1(B) | |
125 ("w" ?$(5!b(B) | |
126 ("W" ?$(5!-(B) | |
127 ("e" ?$(5!Z(B) | |
128 ("E" ?$(5!%(B) | |
129 ("r" ?$(5!\(B) | |
130 ("R" ?$(5!'(B) | |
131 ("t" ?$(5!^(B) | |
132 ("T" ?$(5!)(B) | |
133 ("y" ?$(5!J(B) | |
134 ("Y" ?$(5!K(B) | |
135 ("u" ?$(5!X(B) | |
136 ("U" ?$(5!7(B) | |
137 ("i" ?$(5!5(B) | |
138 ("I" ?$(5!E(B) | |
139 ("o" ?$(5!D(B) | |
140 ("O" ?$(5!C(B) | |
141 ("p" ?$(5!:(B) | |
142 ("P" ?$(5!;(B) | |
143 ("[" ?$(5!?(B) | |
144 ("{" ?$(5!@(B) | |
145 ("]" ?$(5!i(B) | |
146 ("}" ?$(5!<(B) | |
147 ("\\" ?$(5!g(B) | |
148 ("|" ?$(5!2(B) | |
149 ("a" ?$(5!e(B) | |
150 ("A" ?$(5!0(B) | |
151 ("s" ?$(5!a(B) | |
152 ("S" ?$(5!,(B) | |
153 ("d" ?$(5!h(B) | |
154 ("D" ?$(5!$(B) | |
155 ("f" ?$(5![(B) | |
156 ("F" ?$(5!&(B) | |
157 ("g" ?$(5!](B) | |
158 ("G" ?$(5!((B) | |
159 ("h" ?$(5!H(B) | |
160 ("H" ?$(5!I(B) | |
161 ("j" ?$(5!O(B) | |
162 ("J" ?$(5!P(B) | |
163 ("k" ?$(5!3(B) | |
164 ("K" ?$(5!4(B) | |
165 ("l" ?$(5!B(B) | |
166 ("L" ?$(5!C(B) | |
167 (";" ?$(5!8(B) | |
168 (":" ?$(5!9(B) | |
169 ("'" ?$(5!=(B) | |
170 ("\"" ?$(5!>(B) | |
171 ("z" ?$(5!`(B) | |
172 ("Z" ?$(5!+(B) | |
173 ("x" ?$(5!"(B) | |
174 ("X" ?$(5!!(B) | |
175 ("c" ?$(5!L(B) | |
176 ("C" ?$(5!A(B) | |
177 ("v" ?$(5!F(B) | |
178 ("V" ?$(5!G(B) | |
179 ("b" ?$(5!T(B) | |
180 ("B" ?$(5!S(B) | |
181 ("n" ?$(5!Q(B) | |
182 ("N" ?$(5!R(B) | |
183 ("m" ?$(5!W(B) | |
184 ("M" ?$(5!U(B) | |
185 ;; ("," ?,) | |
186 ("<" ?$(5!V(B) | |
187 ;; ("." ?.) | |
188 (">" ?$(5!j(B) | |
189 ("/" ?$(5!M(B) | |
190 ("?" ?$(5!N(B) | |
191 ) | |
192 | |
193 | |
194 ;; | |
195 ;; Quail Devanagari Input By Transliteration | |
196 ;; | |
197 | |
198 (eval-when-compile | |
199 | |
200 (defvar devanagari-consonant-transliteration-alist | |
201 '( | |
202 ; GUTTURALS | |
203 ("k" . "$(5!3(B") | |
204 ("k." . "$(5!3!i(B") | |
205 ("kh" . "$(5!4(B") | |
206 ("kh." . "$(5!4!i(B") | |
207 ("g" . "$(5!5(B") | |
208 ("g." . "$(5!5!i(B") | |
209 ("gh" . "$(5!6(B") | |
210 ("G" . "$(5!7(B") | |
211 ; PALATALS | |
212 ("c" . "$(5!8(B") | |
213 ("ch" . "$(5!9(B") | |
214 ("j" . "$(5!:(B") | |
215 ("j." . "$(5!:!i(B") | |
216 ("Z" . "$(5!:!i(B") | |
217 ("jh" . "$(5!;(B") | |
218 ("J" . "$(5!<(B") | |
219 ; CEREBRALS | |
220 ("T" . "$(5!=(B") | |
221 ("Th" . "$(5!>(B") | |
222 ("D" . "$(5!?(B") | |
223 ("D." . "$(5!?!i(B") | |
224 ("Dh" . "$(5!@(B") | |
225 ("Dh." . "$(5!@!i(B") | |
226 ("N" . "$(5!A(B") | |
227 ; DENTALS | |
228 ("t" . "$(5!B(B") | |
229 ("th" . "$(5!C(B") | |
230 ("d" . "$(5!D(B") | |
231 ("dh" . "$(5!E(B") | |
232 ("n" . "$(5!F(B") | |
233 ("N." . "$(5!G(B") | |
234 ; LABIALS | |
235 ("p" . "$(5!H(B") | |
236 ("ph" . "$(5!I(B") | |
237 ("ph." . "$(5!I!i(B") | |
238 ("f" . "$(5!I(B") | |
239 ("f." . "$(5!I!i(B") | |
240 ("b" . "$(5!J(B") | |
241 ("bh" . "$(5!K(B") | |
242 ("m" . "$(5!L(B") | |
243 ; SEMIVOWELS | |
244 ("y" . "$(5!M(B") | |
245 ("y." . "$(5!N(B") | |
246 ("Y" . "$(5!N(B") | |
247 ("r" . "$(5!O(B") | |
248 ("r." . "$(5!P(B") | |
249 ("l" . "$(5!Q(B") | |
250 ("W" . "$(5!R(B") | |
251 ("W." . "$(5!S(B") | |
252 ("v" . "$(5!T(B") | |
253 ("w" . "$(5!T(B") | |
254 ; SIBILANTS | |
255 ("z" . "$(5!U(B") | |
256 ("S" . "$(5!V(B") | |
257 ("s" . "$(5!W(B") | |
258 ("h" . "$(5!X(B") | |
259 )) | |
260 | |
261 (defvar devanagari-vowel-transliteration-alist | |
262 '( | |
263 ;; Special treatment unique to IS 13194 Transliteration | |
264 ("" . "$(5!h(B") | |
265 ("a" . "") | |
266 ; Matra (Vowel Sign) | |
267 ("A" . "$(5!Z(B") | |
268 ("i" . "$(5![(B") | |
269 ("I" . "$(5!\(B") | |
270 ("u" . "$(5!](B") | |
271 ("U" . "$(5!^(B") | |
272 ("R" . "$(5!_(B") | |
273 ;; ("RR" . "x") ; not specified in ordinary IS 13194.(but in Unicode??) | |
274 ("q" . "$(5#K(B") ; "$(5#K(B" = "$(5!_!i(B" in IS 13194. | |
275 ("L" . "$(5#L(B") ; "$(5#L(B" = "$(5![!i(B" in IS 13194. | |
276 ("E" . "$(5#M(B") ; "$(5#M(B" = "$(5!\!i(B" in IS 13194. | |
277 ("E" . "$(5!`(B") ; only for transcription of other scripts. | |
278 ("e" . "$(5!a(B") | |
279 ("ai" . "$(5!b(B") | |
280 ("ae" . "$(5!b(B") ; variation of transliteration. | |
281 ("EE" . "$(5!c(B") ; only for transcription of other scripts. (Candra E) | |
282 ("O" . "$(5!d(B") ; only for transcription of other scripts. | |
283 ("o" . "$(5!e(B") | |
284 ("au" . "$(5!f(B") | |
285 ("ao" . "$(5!f(B") ; variation of transliteration. | |
286 ("OO" . "$(5!g(B") ; only for transcription of other scripts. (Candra O) | |
287 )) | |
288 | |
289 ;; | |
290 ;; Independent vowels and other signs. | |
291 ;; | |
292 | |
293 (defvar devanagari-other-letters-alist | |
294 '( | |
295 ("a" . "$(5!$(B") | |
296 ("A" . "$(5!%(B") | |
297 ("i" . "$(5!&(B") | |
298 ("I" . "$(5!'(B") | |
299 ("u" . "$(5!((B") | |
300 ("U" . "$(5!)(B") | |
301 ("R" . "$(5!*(B") | |
302 ;; ("RR" . "x") ; not specified in IS 13194. (but in Unicode??) | |
303 ("q" . "$(5#*(B") ; "$(5#*(B" = "$(5!*!i(B" in IS 13194. | |
304 ("L" . "$(5#&(B") ; "$(5#&(B" = "$(5!&!i(B" in IS 13194. | |
305 ("E" . "$(5#'(B") ; "$(5#'(B" = "$(5!'!i(B" in IS 13194. | |
306 ("Ex" . "$(5!+(B") ; only for transcription of other scripts. | |
307 ("e" . "$(5!,(B") | |
308 ("ai" . "$(5!-(B") | |
309 ("EE" . "$(5!.(B") ; only for transcription of other scripts. (Candra E) | |
310 ("O" . "$(5!/(B") ; only for transcription of other scripts. | |
311 ("o" . "$(5!0(B") | |
312 ("au" . "$(5!1(B") | |
313 ("ao" . "$(5!1(B") ; variation of transliteration. | |
314 ("OO" . "$(5!2(B") ; only for transcription of other scripts. (Candra O) | |
315 ("'" . "$(5#J(B") ; avagraha | |
316 ("@" . "$(5#!(B") ; OM | |
317 ("/" . "$(5!j(B") | |
318 ("M" . "$(5!"(B") | |
319 ("&" . "$(5!!(B") | |
320 ("H" . "$(5!#(B") | |
321 ("." . "$(5!i(B") ; Nukta | |
322 ("0" . "$(5!q(B") | |
323 ("1" . "$(5!r(B") | |
324 ("2" . "$(5!s(B") | |
325 ("3" . "$(5!t(B") | |
326 ("4" . "$(5!u(B") | |
327 ("5" . "$(5!v(B") | |
328 ("6" . "$(5!w(B") | |
329 ("7" . "$(5!x(B") | |
330 ("8" . "$(5!y(B") | |
331 ("9" . "$(5!z(B") | |
332 )) | |
333 ) | |
334 | |
335 (defmacro devanagari-transliteration-quail-define-rules () | |
336 (cons 'quail-define-rules | |
337 (let ((cl devanagari-consonant-transliteration-alist) | |
338 (ml devanagari-other-letters-alist) rules) | |
339 (while cl | |
340 (let ((vl devanagari-vowel-transliteration-alist)) | |
341 (while vl | |
342 (setq rules | |
343 (cons (list (concat (car (car cl)) (car (car vl))) | |
344 (make-vector 1 | |
345 (concat (cdr (car cl)) (cdr (car vl))))) | |
346 rules)) | |
347 (setq vl (cdr vl)))) | |
348 (setq cl (cdr cl))) | |
349 (while ml | |
350 (setq rules (cons (list (car (car ml)) | |
351 (make-vector 1 (cdr (car ml)))) | |
352 rules)) | |
353 (setq ml (cdr ml))) | |
354 rules))) | |
355 | |
356 (quail-define-package | |
357 "devanagari-transliteration" "Devanagari" "DEVt" t | |
358 "Devanagari input method by transliteration | |
359 VOWELS : a $(5!$(B A $(5!%(B i $(5!&(B I $(5!'(B u $(5!((B U $(5!)(B | |
360 R $(5!*(B q $(5#*(B L $(5#&(B E $(5#'(B Ex $(5!+(B e $(5!,(B | |
361 ai $(5!-(B EE $(5!.(B O $(5!/(B o $(5!0(B au $(5!1(B OO $(5!2(B | |
362 GRUTTALS : k $(5!3(B kh $(5!4(B g $(5!5(B gh $(5!6(B G $(5!7(B | |
363 PALATALS : c $(5!8(B ch $(5!9(B j $(5!:(B jh $(5!;(B J $(5!<(B (Z $(5!:!i(B) | |
364 CEREBRALS : T $(5!=(B Th $(5!>(B D $(5!?(B Dh $(5!@(B N $(5!A(B | |
365 DENTALS : t $(5!B(B th $(5!C(B d $(5!D(B dh $(5!E(B n $(5!F(B (Nq $(5!G(B) | |
366 LABIALS : p $(5!H(B ph $(5!I(B b $(5!J(B bh $(5!K(B m $(5!L(B (f $(5!I(B) | |
367 SEMIVOWELS : y $(5!M(B Y $(5!N(B r $(5!O(B Rq $(5!P(B | |
368 l $(5!Q(B W $(5!R(B W. $(5!S(B v $(5!T(B w $(5!T(B | |
369 SIBILANTS : z $(5!U(B S $(5!V(B s $(5!W(B h $(5!X(B | |
370 | |
371 Specials : Anuswar M $(5!"(B Visarg H $(5!#(B | |
372 Chandrabindu & $(5!!(B Nukta . $(5!i(B | |
373 Danda / $(5!j(B Avagrah ' $(5#J(B | |
374 OM @ $(5#!(B | |
375 " | |
376 nil t t nil nil nil nil nil | |
377 ;; 'quail-devanagari-update-translation | |
378 nil | |
379 '((" " . quail-devanagari-compose-characters) | |
380 ("-" . quail-devanagari-compose-characters) | |
381 ("," . quail-devanagari-compose-characters) | |
382 ("\C-m" . quail-devanagari-compose-characters) | |
383 ([return] . quail-devanagari-compose-characters)) | |
384 ) | |
385 | |
386 (devanagari-transliteration-quail-define-rules) | |
387 | |
388 ;; | |
389 ;; ITRANS - Indian Script Translation | |
390 ;; | |
391 | |
392 (eval-and-compile | |
393 | |
394 (defun rule-indian-to-devanagari (alist) | |
395 (if (null alist) nil | |
396 (cons (cons (car (car alist)) | |
397 (indian-to-devanagari-string (cdr (car alist)))) | |
398 (rule-indian-to-devanagari (cdr alist))))) | |
399 ) | |
400 | |
401 (eval-when-compile | |
402 | |
403 (defvar devanagari-consonant-itrans-alist | |
404 (rule-indian-to-devanagari indian-itrans-consonant-alist)) | |
405 | |
406 (defvar devanagari-vowel-itrans-alist | |
407 (rule-indian-to-devanagari indian-itrans-vowel-sign-alist)) | |
408 | |
409 (defvar devanagari-other-letters-itrans-alist | |
410 (rule-indian-to-devanagari indian-itrans-other-letters-alist)) | |
411 | |
412 ) | |
413 | |
414 (defmacro devanagari-itrans-quail-define-rules () | |
415 (cons 'quail-define-rules | |
416 (let ((cl devanagari-consonant-itrans-alist) | |
417 (ml devanagari-other-letters-itrans-alist) rules) | |
418 (while cl | |
419 (let ((vl devanagari-vowel-itrans-alist)) | |
420 (while vl | |
421 (setq rules | |
422 (cons (list (concat (car (car cl)) (car (car vl))) | |
423 (make-vector 1 | |
424 (concat (cdr (car cl)) (cdr (car vl))))) | |
425 rules)) | |
426 (setq vl (cdr vl)))) | |
427 (setq cl (cdr cl))) | |
428 (while ml | |
429 (setq rules (cons (list (car (car ml)) | |
430 (make-vector 1 (cdr (car ml)))) | |
431 rules)) | |
432 (setq ml (cdr ml))) | |
433 rules))) | |
434 | |
435 (quail-define-package | |
436 "devanagari-itrans" "Devanagari" "DEVi" t | |
437 "Devanagari input method by ITRANS | |
438 Special Keys : Anuswar n' | |
439 Chandrabindu nn' | |
440 Visarg nh | |
441 Nukta type capital letter for first character. | |
442 $(5!7(B(ng) $(5!<(B(ny) $(5!A(B(nn) $(5!F(B(n) $(5!G(B(nnn) | |
443 " | |
444 nil t t nil nil nil nil nil | |
445 ;; 'quail-devanagari-update-translation | |
446 nil | |
447 '((" " . quail-devanagari-compose-characters) | |
448 ("-" . quail-devanagari-compose-characters) | |
449 ("," . quail-devanagari-compose-characters) | |
450 ("\C-m" . quail-devanagari-compose-characters) | |
451 ([return] . quail-devanagari-compose-characters)) | |
452 ) | |
453 | |
454 (devanagari-itrans-quail-define-rules) | |
455 | |
456 | |
457 ;; | |
458 ;; Quail Hindi Input By Transliteration | |
459 ;; | |
460 | |
461 (defun quail-devanagari-hindi-compose-characters () | |
462 (interactive) | |
463 (if (quail-point-in-conversion-region) | |
464 (let* ((from (overlay-start quail-conv-overlay)) | |
465 (to (overlay-end quail-conv-overlay)) | |
466 (dstr (buffer-substring from to))) | |
23891
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
467 (setq overriding-terminal-local-map nil |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
468 quail-converting nil |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
469 quail-conversion-str |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
470 (concat (devanagari-compose-string dstr) |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
471 (list (if (numberp last-command-char) |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
472 last-command-char |
db21a8833d0f
(quail-devanagari-compose-characters):
Kenichi Handa <handa@m17n.org>
parents:
19518
diff
changeset
|
473 (get last-command-char 'ascii-character)))))))) |
18673 | 474 |
475 (eval-when-compile | |
476 | |
477 (defvar devanagari-hindi-consonant-transliteration-alist | |
478 '( | |
479 ; GUTTURALS | |
480 ("k" . "$(5!3(B") | |
481 ("ks" . "$(5$.(B") | |
482 ("k." . "$(5!3!i(B") | |
483 ("kh" . "$(5!4(B") | |
484 ("kh." . "$(5!4!i(B") | |
485 ("g" . "$(5!5(B") | |
486 ("g." . "$(5!5!i(B") | |
487 ("gh" . "$(5!6(B") | |
488 ("G" . "$(5!7(B") | |
489 ; PALATALS | |
490 ("ch" . "$(5!8(B") | |
491 ("chh" . "$(5!9(B") | |
492 ("j" . "$(5!:(B") | |
493 ("j." . "$(5!:!i(B") | |
494 ("z" . "$(5!:!i(B") | |
495 ("jh" . "$(5!;(B") | |
496 ("J" . "$(5!<(B") | |
497 ; CEREBRALS | |
498 ("T" . "$(5!=(B") | |
499 ("Th" . "$(5!>(B") | |
500 ("D" . "$(5!?(B") | |
501 ("D." . "$(5!?!i(B") | |
502 ("Dh" . "$(5!@(B") | |
503 ("Dh." . "$(5!@!i(B") | |
504 ("N" . "$(5!A(B") | |
505 ; DENTALS | |
506 ("t" . "$(5!B(B") | |
507 ("th" . "$(5!C(B") | |
508 ("d" . "$(5!D(B") | |
509 ("dh" . "$(5!E(B") | |
510 ("n" . "$(5!F(B") | |
511 ("N." . "$(5!G(B") | |
512 ; LABIALS | |
513 ("p" . "$(5!H(B") | |
514 ("ph" . "$(5!I(B") | |
515 ("ph." . "$(5!I!i(B") | |
516 ("f" . "$(5!I(B") | |
517 ("f." . "$(5!I!i(B") | |
518 ("b" . "$(5!J(B") | |
519 ("bh" . "$(5!K(B") | |
520 ("m" . "$(5!L(B") | |
521 ; SEMIVOWELS | |
522 ("y" . "$(5!M(B") | |
523 ("y." . "$(5!N(B") | |
524 ("Y" . "$(5!N(B") | |
525 ("r" . "$(5!O(B") | |
526 ("r." . "$(5!P(B") | |
527 ("l" . "$(5!Q(B") | |
528 ("W" . "$(5!R(B") | |
529 ("W." . "$(5!S(B") | |
530 ("v" . "$(5!T(B") | |
531 ("w" . "$(5!T(B") | |
532 ; SIBILANTS | |
533 ("sh" . "$(5!U(B") | |
534 ("S" . "$(5!V(B") | |
535 ("s" . "$(5!W(B") | |
536 ("h" . "$(5!X(B") | |
537 ; Special for Hindi | |
538 ("ks" . "$(5$.(B") | |
539 ("tr" . "$(5"%(B") | |
540 ("xn" . "$(5$E(B") | |
541 )) | |
542 | |
543 (defvar devanagari-hindi-vowel-transliteration-alist | |
544 '( | |
545 ; In hindi, halant sign is rarely used so should explicity typed in. | |
546 ("" . "") | |
547 ("~" . "$(5!h(B") | |
548 ; Matra (Vowel Sign) | |
549 ("a" . "$(5!Z(B") | |
550 ("i" . "$(5![(B") | |
551 ("I" . "$(5!\(B") | |
552 ("u" . "$(5!](B") | |
553 ("U" . "$(5!^(B") | |
554 ("R" . "$(5!_(B") | |
555 ;; ("RR" . "x") ; not specified in ordinary IS 13194.(but in Unicode??) | |
556 ("q" . "$(5#K(B") ; "$(5#K(B" = "$(5!_!i(B" in IS 13194. | |
557 ("L" . "$(5#L(B") ; "$(5#L(B" = "$(5![!i(B" in IS 13194. | |
558 ("E" . "$(5#M(B") ; "$(5#M(B" = "$(5!\!i(B" in IS 13194. | |
559 ("E" . "$(5!`(B") ; only for transcription of other scripts. | |
560 ("e" . "$(5!a(B") | |
561 ("ai" . "$(5!b(B") | |
562 ("ae" . "$(5!b(B") ; variation of transliteration. | |
563 ("EE" . "$(5!c(B") ; only for transcription of other scripts. (Candra E) | |
564 ("O" . "$(5!d(B") ; only for transcription of other scripts. | |
565 ("o" . "$(5!e(B") | |
566 ("au" . "$(5!f(B") | |
567 ("ao" . "$(5!f(B") ; variation of transliteration. | |
568 ("OO" . "$(5!g(B") ; only for transcription of other scripts. (Candra O) | |
569 )) | |
570 | |
571 ;; | |
572 ;; Independent vowels and other signs. | |
573 ;; | |
574 | |
575 (defvar devanagari-hindi-other-letters-alist | |
576 '( | |
577 ("a" . "$(5!$(B") | |
578 ("A" . "$(5!%(B") | |
579 ("i" . "$(5!&(B") | |
580 ("I" . "$(5!'(B") | |
581 ("u" . "$(5!((B") | |
582 ("U" . "$(5!)(B") | |
583 ("R" . "$(5!*(B") | |
584 ;; ("RR" . "x") ; not specified in IS 13194. (but in Unicode??) | |
585 ("q" . "$(5#*(B") ; "$(5#*(B" = "$(5!*!i(B" in IS 13194. | |
586 ("L" . "$(5#&(B") ; "$(5#&(B" = "$(5!&!i(B" in IS 13194. | |
587 ("E" . "$(5#'(B") ; "$(5#'(B" = "$(5!'!i(B" in IS 13194. | |
588 ("Ex" . "$(5!+(B") ; only for transcription of other scripts. | |
589 ("e" . "$(5!,(B") | |
590 ("ai" . "$(5!-(B") | |
591 ("EE" . "$(5!.(B") ; only for transcription of other scripts. (Candra E) | |
592 ("O" . "$(5!/(B") ; only for transcription of other scripts. | |
593 ("o" . "$(5!0(B") | |
594 ("au" . "$(5!1(B") | |
595 ("ao" . "$(5!1(B") ; variation of transliteration. | |
596 ("OO" . "$(5!2(B") ; only for transcription of other scripts. (Candra O) | |
597 ("'" . "$(5#J(B") ; avagraha | |
598 ("@" . "$(5#!(B") ; OM | |
599 ("/" . "$(5!j(B") | |
600 ("M" . "$(5!"(B") | |
601 ("&" . "$(5!!(B") | |
602 ("H" . "$(5!#(B") | |
603 ("." . "$(5!i(B") ; Nukta | |
604 ("0" . "$(5!q(B") | |
605 ("1" . "$(5!r(B") | |
606 ("2" . "$(5!s(B") | |
607 ("3" . "$(5!t(B") | |
608 ("4" . "$(5!u(B") | |
609 ("5" . "$(5!v(B") | |
610 ("6" . "$(5!w(B") | |
611 ("7" . "$(5!x(B") | |
612 ("8" . "$(5!y(B") | |
613 ("9" . "$(5!z(B") | |
614 )) | |
615 ) | |
616 | |
617 (defmacro devanagari-hindi-transliteration-quail-define-rules () | |
618 (cons 'quail-define-rules | |
619 (let ((cl devanagari-hindi-consonant-transliteration-alist) | |
620 (ml devanagari-hindi-other-letters-alist) rules) | |
621 (while cl | |
622 (let ((vl devanagari-hindi-vowel-transliteration-alist)) | |
623 (while vl | |
624 (setq rules | |
625 (cons (list (concat (car (car cl)) (car (car vl))) | |
626 (make-vector 1 | |
627 (concat (cdr (car cl)) (cdr (car vl))))) | |
628 rules)) | |
629 (setq vl (cdr vl)))) | |
630 (setq cl (cdr cl))) | |
631 (while ml | |
632 (setq rules (cons (list (car (car ml)) | |
633 (make-vector 1 (cdr (car ml)))) | |
634 rules)) | |
635 (setq ml (cdr ml))) | |
636 rules))) | |
637 | |
638 (quail-define-package | |
639 "devanagari-hindi-transliteration" "Hindi" "HINt" t | |
640 "Devanagari-Hindi input method by transliteration | |
641 VOWELS : a $(5!$(B A $(5!%(B i $(5!&(B I $(5!'(B u $(5!((B U $(5!)(B | |
642 R $(5!*(B q $(5#*(B L $(5#&(B E $(5#'(B Ex $(5!+(B e $(5!,(B | |
643 ai $(5!-(B EE $(5!.(B O $(5!/(B o $(5!0(B au $(5!1(B OO $(5!2(B | |
644 GRUTTALS : k $(5!3(B kh $(5!4(B g $(5!5(B gh $(5!6(B G $(5!7(B | |
645 PALATALS : c $(5!8(B ch $(5!9(B j $(5!:(B jh $(5!;(B J $(5!<(B z $(5!:!i(B | |
646 CEREBRALS : T $(5!=(B Th $(5!>(B D $(5!?(B Dh $(5!@(B N $(5!A(B | |
647 DENTALS : t $(5!B(B th $(5!C(B d $(5!D(B dh $(5!E(B n $(5!F(B (Nq $(5!G(B) | |
648 LABIALS : p $(5!H(B ph $(5!I(B b $(5!J(B bh $(5!K(B m $(5!L(B (f $(5!I(B) | |
649 SEMIVOWELS : y $(5!M(B Y $(5!N(B r $(5!O(B Rq $(5!P(B | |
650 l $(5!Q(B W $(5!R(B W. $(5!S(B v $(5!T(B w $(5!T(B | |
651 SIBILANTS : sh $(5!U(B S $(5!V(B s $(5!W(B h $(5!X(B | |
652 OTHERS : ks $(5$.(B tr $(5"%(B xn $(5$E(B | |
653 | |
654 Specials : Anuswar M $(5!"(B Visarg H $(5!#(B | |
655 Chandrabindu & $(5!!(B Nukta . $(5!i(B | |
656 Danda / $(5!j(B Avagrah ' $(5#J(B | |
657 OM @ $(5#!(B Halant ~ $(5!h(B | |
658 " | |
659 nil t t nil nil nil nil nil | |
660 ;; 'quail-devanagari-update-translation | |
661 nil | |
662 '((" " . quail-devanagari-hindi-compose-characters) | |
663 ("-" . quail-devanagari-hindi-compose-characters) | |
664 ("," . quail-devanagari-hindi-compose-characters) | |
665 ("\C-m" . quail-devanagari-hindi-compose-characters) | |
666 ([return] . quail-devanagari-hindi-compose-characters)) | |
667 ) | |
668 | |
669 (devanagari-hindi-transliteration-quail-define-rules) |