1 ;;; indian.el --- Quail packages for inputting Indian
3 ;; Copyright (C) 2000-2018 Free Software Foundation, Inc.
5 ;; Author: KAWABATA, Taichi <kawabata@m17n.org>
7 ;; Keywords: multilingual, input method, Indian, Devanagari
9 ;; This file is part of GNU Emacs.
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 3 of the License, or
14 ;; (at your option) any later version.
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.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
29 ;; Totally re-written from devanagari.el to handle multiple Indian Scripts.
37 ;;; Input by transliteration
40 (defun quail-define-indian-trans-package (hashtbls pkgname
42 (funcall 'quail-define-package pkgname lang title t doc
43 nil nil nil nil nil nil t nil
)
46 (quail-defrule key
(if (= (length val
) 1)
51 ;; This needs to be seen by quail-update-leim-list-file, but cannot be
52 ;; commented out because quail-update-leim-list-file ignores
53 ;; commented-out lines.
55 (quail-define-package "devanagari-itrans" "Devanagari" "DevIT" t
"Devanagari ITRANS"))
56 (quail-define-indian-trans-package
57 indian-dev-itrans-v5-hash
"devanagari-itrans" "Devanagari" "DevIT"
58 "Devanagari transliteration by ITRANS method.")
59 (quail-defrule "..." ?॥
)
60 (quail-defrule "\\'" ?॑
)
61 (quail-defrule "\\_" ?॒
)
62 (quail-defrule "\\__" ?_
)
63 (quail-defrule "\\''" ?
')
66 (quail-define-package "devanagari-kyoto-harvard" "Devanagari" "DevKH" t
"Devanagari Kyoto-Harvard"))
67 (quail-define-indian-trans-package
68 indian-dev-kyoto-harvard-hash
69 "devanagari-kyoto-harvard" "Devanagari" "DevKH"
70 "Devanagari transliteration by Kyoto-Harvard method.")
73 (quail-define-package "devanagari-aiba" "Devanagari" "DevAB" t
"Devanagari Aiba"))
74 (quail-define-indian-trans-package
75 indian-dev-aiba-hash
"devanagari-aiba" "Devanagari" "DevAB"
76 "Devanagari transliteration by Aiba-method.")
79 (quail-define-package "punjabi-itrans" "Punjabi" "PnjIT" t
"Punjabi ITRANS"))
80 (quail-define-indian-trans-package
81 indian-pnj-itrans-v5-hash
"punjabi-itrans" "Punjabi" "PnjIT"
82 "Punjabi transliteration by ITRANS method.")
85 (quail-define-package "gujarati-itrans" "Gujarati" "GjrIT" t
"Gujarati ITRANS"))
86 (quail-define-indian-trans-package
87 indian-gjr-itrans-v5-hash
"gujarati-itrans" "Gujarati" "GjrIT"
88 "Gujarati transliteration by ITRANS method.")
91 (quail-define-package "oriya-itrans" "Oriya" "OriIT" t
"Oriya ITRANS"))
92 (quail-define-indian-trans-package
93 indian-ori-itrans-v5-hash
"oriya-itrans" "Oriya" "OriIT"
94 "Oriya transliteration by ITRANS method.")
97 (quail-define-package "bengali-itrans" "Bengali" "BngIT" t
"Bengali ITRANS"))
98 (quail-define-indian-trans-package
99 indian-bng-itrans-v5-hash
"bengali-itrans" "Bengali" "BngIT"
100 "Bengali transliteration by ITRANS method.")
103 (quail-define-package "assamese-itrans" "Assamese" "AsmIT" t
"Assamese ITRANS"))
104 (quail-define-indian-trans-package
105 indian-asm-itrans-v5-hash
"assamese-itrans" "Assamese" "AsmIT"
106 "Assamese transliteration by ITRANS method.")
109 (quail-define-package "telugu-itrans" "Telugu" "TlgIT" t
"Telugu ITRANS"))
110 (quail-define-indian-trans-package
111 indian-tlg-itrans-v5-hash
"telugu-itrans" "Telugu" "TlgIT"
112 "Telugu transliteration by ITRANS method.")
115 (quail-define-package "kannada-itrans" "Kannada" "KndIT" t
"Kannada ITRANS"))
116 (quail-define-indian-trans-package
117 indian-knd-itrans-v5-hash
"kannada-itrans" "Kannada" "KndIT"
118 "Kannada transliteration by ITRANS method.")
121 (quail-define-package "malayalam-itrans" "Malayalam" "MlmIT" t
"Malayalam ITRANS"))
122 (quail-define-indian-trans-package
123 indian-mlm-itrans-v5-hash
"malayalam-itrans" "Malayalam" "MlmIT"
124 "Malayalam transliteration by ITRANS method.")
126 (defvar quail-tamil-itrans-syllable-table
164 ("க்ஷ" "x" ) ; U+0B95
175 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
177 (setq clm
(+ clm
6)))
181 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
183 (setq clm
(+ clm
6)))
184 (dolist (c consonants
)
188 (insert (car c
) virama
189 (propertize "\t" 'display
'(space :align-to
4))
193 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
194 (car c
) (or (nth 1 v
) ""))
195 (setq clm
(+ clm
6)))
196 (insert "\n" (or (nth 1 c
) "")
197 (propertize "\t" 'display
'(space :align-to
4))
202 (apply 'insert
(propertize "\t" 'display
(list 'space
:align-to clm
))
203 (if (nth 1 c
) (list (nth 1 c
) (nth 2 v
)) (list "")))
204 (setq clm
(+ clm
6))))
211 (defvar quail-tamil-itrans-numerics-and-symbols-table
212 (let ((numerics '((?௰
"பத்து") (?௱
"நூறு") (?௲
"ஆயிரம்")))
213 (symbols '((?௳
"நாள்") (?௴
"மாதம்") (?௵
"வருடம்")
214 (?௶
"பற்று") (?௷
"வரவு") (?௸
"மேற்படி")
215 (?௹
"ரூபாய்") (?௺
"எண்")))
218 (insert "\n" (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
220 (propertize "\t" 'display
'(space :align-to
5)) "numerics"
221 (propertize "\t" 'display
'(space :align-to
18)) "|"
222 (propertize "\t" 'display
'(space :align-to
45)) "symbols")
223 (insert "\n" (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
226 (dolist (elm numerics
)
228 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))))
230 (setq clm
(+ clm
5)))
231 (insert (propertize "\t" 'display
'(space :align-to
18)) "|")
233 (dolist (elm symbols
)
235 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))))
237 (setq clm
(+ clm
8)))
239 (insert (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
243 (defvar quail-tamil-itrans-various-signs-and-digits-table
244 (let ((various '((?ஃ .
"H") ("ஸ்ரீ" .
"srii") (?ௐ
)))
245 (digits "௦௧௨௩௪௫௬௭௮௯")
248 (insert "\n" (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
250 (propertize "\t" 'display
'(space :align-to
5)) "various"
251 (propertize "\t" 'display
'(space :align-to
18)) "|"
252 (propertize "\t" 'display
'(space :align-to
45)) "digits")
254 (insert "\n" (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
257 (dotimes (i (length various
))
258 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
259 (car (nth i various
)))
260 (setq clm
(+ clm width
)))
261 (insert (propertize "\t" 'display
'(space :align-to
18)) "|")
264 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
266 (setq clm
(+ clm width
)))
269 (dotimes (i (length various
))
270 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
271 (or (cdr (nth i various
)) ""))
272 (setq clm
(+ clm width
)))
273 (insert (propertize "\t" 'display
'(space :align-to
18)) "|")
276 (insert (propertize "\t" 'display
(list 'space
:align-to clm
))
278 (setq clm
(+ clm width
)))
279 (insert "\n" (make-string 18 ?-
) "+" (make-string 60 ?-
) "\n")
283 (quail-define-package "tamil-itrans" "Tamil" "TmlIT" t
"Tamil ITRANS"))
284 (quail-define-indian-trans-package
285 indian-tml-itrans-v5-hash
"tamil-itrans" "Tamil" "TmlIT"
286 "Tamil transliteration by ITRANS method.
288 You can input characters using the following mapping tables.
289 Example: To enter வணக்கம், type vaNakkam.
291 ### Basic syllables (consonants + vowels) ###
292 \\<quail-tamil-itrans-syllable-table>
294 ### Miscellaneous (various signs + digits) ###
295 \\<quail-tamil-itrans-various-signs-and-digits-table>
297 ### Others (numerics + symbols) ###
299 Characters below have no ITRANS method associated with them.
300 Their descriptions are included for easy reference.
301 \\<quail-tamil-itrans-numerics-and-symbols-table>
303 Full key sequences are listed below:")
306 ;;; Input by Inscript
309 (defun quail-define-inscript-package (char-tables key-tables pkgname lang
311 (funcall 'quail-define-package pkgname lang title nil docstring
312 nil nil nil t nil nil nil nil
)
313 (let (char-table key-table char key
)
314 (while (and char-tables key-tables
)
315 (setq char-table
(car char-tables
)
316 char-tables
(cdr char-tables
)
317 key-table
(car key-tables
)
318 key-tables
(cdr key-tables
))
319 (while (and char-table key-table
)
320 (setq char
(car char-table
)
321 char-table
(cdr char-table
)
323 key-table
(cdr key-table
))
324 (if (and (consp char
) (consp key
))
325 (setq char-table
(append char char-table
)
326 key-table
(append key key-table
))
329 (if (characterp key
) (char-to-string key
) key
)
330 (if (stringp char
) (vector char
) char
))))))))
334 (defvar inscript-dev-keytable
337 (?D nil
) (?E ?e
) (?F ?f
) (?R ?r
) (?G ?g
) (?T ?t
)
338 (?
+ ?
=) ("F]" "f]") (?
! ?
@) (?Z ?z
) (?S ?s
) (?W ?w
)
339 (?| ?
\\) (?~ ?
`) (?A ?a
) (?Q ?q
) ("+]" "=]") ("R]" "r]"))
341 ?k ?K ?i ?I ?U
;; GRUTTALS
342 ?\
; ?: ?p ?P ?} ;; PALATALS
343 ?
' ?
\" ?\
[ ?
{ ?C
;; CEREBRALS
344 ?l ?L ?o ?O ?v ?V
;; DENTALS
345 ?h ?H ?y ?Y ?c
;; LABIALS
346 ?
/ ?j ?J ?n ?N
"N]" ?b
;; SEMIVOWELS
347 ?M ?
< ?m ?u
;; SIBILANTS
348 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
351 ?X ?x ?_
">]" ?d
"X]" ?
>)
353 ?
0 ?
1 ?
2 ?
3 ?
4 ?
5 ?
6 ?
7 ?
8 ?
9)
357 (defvar inscript-mlm-keytable
360 (?D nil
) (?E ?e
) (?F ?f
) (?R ?r
) (?G ?g
) (?T ?t
)
361 (?
+ ?
=) ("F]" "f]") (?
! ?
@) (?S ?s
) (?Z ?z
) (?W ?w
)
362 (?| ?
\\) (?~ ?
`) (?A ?a
) (?Q ?q
) ("+]" "=]") ("R]" "r]"))
364 ?k ?K ?i ?I ?U
;; GRUTTALS
365 ?\
; ?: ?p ?P ?} ;; PALATALS
366 ?
' ?
\" ?\
[ ?
{ ?C
;; CEREBRALS
367 ?l ?L ?o ?O ?v ?V
;; DENTALS
368 ?h ?H ?y ?Y ?c
;; LABIALS
369 ?
/ ?j ?J ?n ?N
"N]" ?b
;; SEMIVOWELS
370 ?M ?
< ?m ?u
;; SIBILANTS
371 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
374 ?X ?x ?_
">]" ?d
"X]" ?
>)
376 ?
0 ?
1 ?
2 ?
3 ?
4 ?
5 ?
6 ?
7 ?
8 ?
9)
380 (defvar inscript-tml-keytable
383 (?D nil
) (?E ?e
) (?F ?f
) (?R ?r
) (?G ?g
) (?T ?t
)
384 nil nil nil
(?S ?s
) (?Z ?z
) (?W ?w
)
385 nil
(?A ?a
) (?~ ?
`) (?Q ?q
) nil nil
)
387 ?k ?K ?i ?I ?U
;; GRUTTALS
388 ?\
; ?: ?p ?P ?} ;; PALATALS
389 ?
' ?
\" ?\
[ ?
{ ?C
;; CEREBRALS
390 ?l ?L ?o ?O ?v ?V
;; DENTALS
391 ?h ?H ?y ?Y ?c
;; LABIALS
392 ?
/ ?j ?J ?n ?N
"N]" ?b
;; SEMIVOWELS
393 ?M ?
< ?m ?u
;; SIBILANTS
394 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
397 ?X ?x ?_
">]" ?d
"X]" ?
>)
399 ?
0 ?
1 ?
2 ?
3 ?
4 ?
5 ?
6 ?
7 ?
8 ?
9)
404 (quail-define-package "devanagari-inscript" "Devanagari" "DevIS" t
"Devanagari keyboard Inscript"))
405 (quail-define-inscript-package
406 indian-dev-base-table inscript-dev-keytable
407 "devanagari-inscript" "Devanagari" "DevIS"
408 "Devanagari keyboard Inscript.")
411 (quail-define-package "punjabi-inscript" "Punjabi" "PnjIS" t
"Punjabi keyboard Inscript"))
412 (quail-define-inscript-package
413 indian-pnj-base-table inscript-dev-keytable
414 "punjabi-inscript" "Punjabi" "PnjIS"
415 "Punjabi keyboard Inscript.")
418 (quail-define-package "gujarati-inscript" "Gujarati" "GjrIS" t
"Gujarati keyboard Inscript"))
419 (quail-define-inscript-package
420 indian-gjr-base-table inscript-dev-keytable
421 "gujarati-inscript" "Gujarati" "GjrIS"
422 "Gujarati keyboard Inscript.")
425 (quail-define-package "oriya-inscript" "Oriya" "OriIS" t
"Oriya keyboard Inscript"))
426 (quail-define-inscript-package
427 indian-ori-base-table inscript-dev-keytable
428 "oriya-inscript" "Oriya" "OriIS"
429 "Oriya keyboard Inscript.")
432 (quail-define-package "bengali-inscript" "Bengali" "BngIS" t
"Bengali keyboard Inscript"))
433 (quail-define-inscript-package
434 indian-bng-base-table inscript-dev-keytable
435 "bengali-inscript" "Bengali" "BngIS"
436 "Bengali keyboard Inscript.")
439 (quail-define-package "assamese-inscript" "Assamese" "AsmIS" t
"Assamese keyboard Inscript"))
440 (quail-define-inscript-package
441 indian-asm-base-table inscript-dev-keytable
442 "assamese-inscript" "Assamese" "AsmIS"
443 "Assamese keyboard Inscript.")
446 (quail-define-package "telugu-inscript" "Telugu" "TlgIS" t
"Telugu keyboard Inscript"))
447 (quail-define-inscript-package
448 indian-tlg-base-table inscript-dev-keytable
449 "telugu-inscript" "Telugu" "TlgIS"
450 "Telugu keyboard Inscript.")
453 (quail-define-package "kannada-inscript" "Kannada" "KndIS" t
"Kannada keyboard Inscript"))
454 (quail-define-inscript-package
455 indian-knd-base-table inscript-dev-keytable
456 "kannada-inscript" "Kannada" "KndIS"
457 "Kannada keyboard Inscript.")
460 (quail-define-package "malayalam-inscript" "Malayalam" "MlmIS" t
"Malayalam keyboard Inscript"))
461 (quail-define-inscript-package
462 indian-mlm-base-table inscript-mlm-keytable
463 "malayalam-inscript" "Malayalam" "MlmIS"
464 "Malayalam keyboard Inscript.")
467 (quail-define-package "tamil-inscript" "Tamil" "TmlIS" t
"Tamil keyboard Inscript"))
468 (quail-define-inscript-package
469 indian-tml-base-table inscript-tml-keytable
470 "tamil-inscript" "Tamil" "TmlIS"
471 "Tamil keyboard Inscript.")
473 ;; Probhat Input Method
474 (quail-define-package
475 "bengali-probhat" "Bengali" "BngPB" t
476 "Probhat keyboard for Bengali/Bangla" nil t nil nil nil nil nil nil nil nil t
)
574 ;;; indian.el ends here