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