Fix some file names.
[emacs.git] / leim / quail / indian.el
blob40f851dd422731570f37095b4eaa31cc69fddb6c
1 ;;; indian.el --- Quail packages for inputting Indian
3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 ;; Free Software Foundation, Inc.
6 ;; Author: KAWABATA, Taichi <kawabata@m17n.org>
8 ;; Keywords: multilingual, input method, Indian, Devanagari
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;; History:
29 ;; 2000.12.12
30 ;; Totally re-written from devanagari.el to handle multiple Indian Scripts.
32 ;;; Code:
34 (require 'quail)
35 (require 'ind-util)
37 ;;;
38 ;;; Input by transliteration
39 ;;;
41 (defun quail-define-indian-trans-package (hashtbls pkgname
42 lang title doc)
43 (funcall 'quail-define-package pkgname lang title t doc
44 nil nil nil nil nil nil t nil)
45 (maphash
46 (lambda (key val)
47 (quail-defrule key (if (= (length val) 1)
48 (string-to-char val)
49 (vector val))))
50 (cdr hashtbls)))
52 ;; This needs to be seen by quail-update-leim-list-file, but cannot be
53 ;; commented out because quail-update-leim-list-file ignores
54 ;; commented-out lines.
55 (if nil
56 (quail-define-package "devanagari-itrans" "Devanagari" "DevIT" t "Devanagari ITRANS"))
57 (quail-define-indian-trans-package
58 indian-dev-itrans-v5-hash "devanagari-itrans" "Devanagari" "DevIT"
59 "Devanagari transliteration by ITRANS method.")
61 (if nil
62 (quail-define-package "devanagari-kyoto-harvard" "Devanagari" "DevKH" t "Devanagari Kyoto-Harvard"))
63 (quail-define-indian-trans-package
64 indian-dev-kyoto-harvard-hash
65 "devanagari-kyoto-harvard" "Devanagari" "DevKH"
66 "Devanagari transliteration by Kyoto-Harvard method.")
68 (if nil
69 (quail-define-package "devanagari-aiba" "Devanagari" "DevAB" t "Devanagari Aiba"))
70 (quail-define-indian-trans-package
71 indian-dev-aiba-hash "devanagari-aiba" "Devanagari" "DevAB"
72 "Devanagari transliteration by Aiba-method.")
74 (if nil
75 (quail-define-package "punjabi-itrans" "Punjabi" "PnjIT" t "Punjabi ITRANS"))
76 (quail-define-indian-trans-package
77 indian-pnj-itrans-v5-hash "punjabi-itrans" "Punjabi" "PnjIT"
78 "Punjabi transliteration by ITRANS method.")
80 (if nil
81 (quail-define-package "gujarati-itrans" "Gujarati" "GjrIT" t "Gujarati ITRANS"))
82 (quail-define-indian-trans-package
83 indian-gjr-itrans-v5-hash "gujarati-itrans" "Gujarati" "GjrIT"
84 "Gujarati transliteration by ITRANS method.")
86 (if nil
87 (quail-define-package "oriya-itrans" "Oriya" "OriIT" t "Oriya ITRANS"))
88 (quail-define-indian-trans-package
89 indian-ori-itrans-v5-hash "oriya-itrans" "Oriya" "OriIT"
90 "Oriya transliteration by ITRANS method.")
92 (if nil
93 (quail-define-package "bengali-itrans" "Bengali" "BngIT" t "Bengali ITRANS"))
94 (quail-define-indian-trans-package
95 indian-bng-itrans-v5-hash "bengali-itrans" "Bengali" "BngIT"
96 "Bengali transliteration by ITRANS method.")
98 (if nil
99 (quail-define-package "assamese-itrans" "Assamese" "AsmIT" t "Assamese ITRANS"))
100 (quail-define-indian-trans-package
101 indian-asm-itrans-v5-hash "assamese-itrans" "Assamese" "AsmIT"
102 "Assamese transliteration by ITRANS method.")
104 (if nil
105 (quail-define-package "telugu-itrans" "Telugu" "TlgIT" t "Telugu ITRANS"))
106 (quail-define-indian-trans-package
107 indian-tlg-itrans-v5-hash "telugu-itrans" "Telugu" "TlgIT"
108 "Telugu transliteration by ITRANS method.")
110 (if nil
111 (quail-define-package "kannada-itrans" "Kannada" "KndIT" t "Kannada ITRANS"))
112 (quail-define-indian-trans-package
113 indian-knd-itrans-v5-hash "kannada-itrans" "Kannada" "KndIT"
114 "Kannada transliteration by ITRANS method.")
116 (if nil
117 (quail-define-package "malayalam-itrans" "Malayalam" "MlmIT" t "Malayalam ITRANS"))
118 (quail-define-indian-trans-package
119 indian-mlm-itrans-v5-hash "malayalam-itrans" "Malayalam" "MlmIT"
120 "Malayalam transliteration by ITRANS method.")
122 (if nil
123 (quail-define-package "tamil-itrans" "Tamil" "TmlIT" t "Tamil ITRANS"))
124 (quail-define-indian-trans-package
125 indian-tml-itrans-v5-hash "tamil-itrans" "Tamil" "TmlIT"
126 "Tamil transliteration by ITRANS method.")
130 ;;; Input by Inscript
133 (defun quail-define-inscript-package (char-tables key-tables pkgname lang
134 title docstring)
135 (funcall 'quail-define-package pkgname lang title nil docstring
136 nil nil nil nil nil nil nil nil)
137 (let (char-table key-table char key)
138 (while (and char-tables key-tables)
139 (setq char-table (car char-tables)
140 char-tables (cdr char-tables)
141 key-table (car key-tables)
142 key-tables (cdr key-tables))
143 (while (and char-table key-table)
144 (setq char (car char-table)
145 char-table (cdr char-table)
146 key (car key-table)
147 key-table (cdr key-table))
148 (if (and (consp char) (consp key))
149 (setq char-table (append char char-table)
150 key-table (append key key-table))
151 (if (and key char)
152 (quail-defrule
153 (if (characterp key) (char-to-string key) key)
154 (if (stringp char) (vector char) char))))))))
158 (defvar inscript-dev-keytable
160 (;; VOWELS (18)
161 (?D nil) (?E ?e) (?F ?f) (?R ?r) (?G ?g) (?T ?t)
162 (?+ ?=) ("F]" "f]") (?! ?@) (?Z ?z) (?S ?s) (?W ?w)
163 (?| ?\\) (?~ ?`) (?A ?a) (?Q ?q) ("+]" "=]") ("R]" "r]"))
164 (;; CONSONANTS (42)
165 ?k ?K ?i ?I ?U ;; GRUTTALS
166 ?\; ?: ?p ?P ?} ;; PALATALS
167 ?' ?\" ?\[ ?{ ?C ;; CEREBRALS
168 ?l ?L ?o ?O ?v ?V ;; DENTALS
169 ?h ?H ?y ?Y ?c ;; LABIALS
170 ?/ ?j ?J ?n ?N "N]" ?b ;; SEMIVOWELS
171 ?M ?< ?m ?u ;; SIBILANTS
172 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
173 ?% ?&)
174 (;; Misc Symbols (7)
175 ?X ?x ?_ ">]" ?d "X]" ?>)
176 (;; Digits
177 ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
178 (;; Inscripts
179 ?# ?$ ?^ ?* ?\])))
181 (defvar inscript-mlm-keytable
183 (;; VOWELS (18)
184 (?D nil) (?E ?e) (?F ?f) (?R ?r) (?G ?g) (?T ?t)
185 (?+ ?=) ("F]" "f]") (?! ?@) (?S ?s) (?Z ?z) (?W ?w)
186 (?| ?\\) (?~ ?`) (?A ?a) (?Q ?q) ("+]" "=]") ("R]" "r]"))
187 (;; CONSONANTS (42)
188 ?k ?K ?i ?I ?U ;; GRUTTALS
189 ?\; ?: ?p ?P ?} ;; PALATALS
190 ?' ?\" ?\[ ?{ ?C ;; CEREBRALS
191 ?l ?L ?o ?O ?v ?V ;; DENTALS
192 ?h ?H ?y ?Y ?c ;; LABIALS
193 ?/ ?j ?J ?n ?N "N]" ?b ;; SEMIVOWELS
194 ?M ?< ?m ?u ;; SIBILANTS
195 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
196 ?% ?&)
197 (;; Misc Symbols (7)
198 ?X ?x ?_ ">]" ?d "X]" ?>)
199 (;; Digits
200 ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
201 (;; Inscripts
202 ?# ?$ ?^ ?* ?\])))
204 (defvar inscript-tml-keytable
206 (;; VOWELS (18)
207 (?D nil) (?E ?e) (?F ?f) (?R ?r) (?G ?g) (?T ?t)
208 nil nil nil (?S ?s) (?Z ?z) (?W ?w)
209 nil (?A ?a) (?~ ?`) (?Q ?q) nil nil)
210 (;; CONSONANTS (42)
211 ?k ?K ?i ?I ?U ;; GRUTTALS
212 ?\; ?: ?p ?P ?} ;; PALATALS
213 ?' ?\" ?\[ ?{ ?C ;; CEREBRALS
214 ?l ?L ?o ?O ?v ?V ;; DENTALS
215 ?h ?H ?y ?Y ?c ;; LABIALS
216 ?/ ?j ?J ?n ?N "N]" ?b ;; SEMIVOWELS
217 ?M ?< ?m ?u ;; SIBILANTS
218 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
219 ?% ?&)
220 (;; Misc Symbols (7)
221 ?X ?x ?_ ">]" ?d "X]" ?>)
222 (;; Digits
223 ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
224 (;; Inscripts
225 ?# ?$ ?^ ?* ?\])))
227 (if nil
228 (quail-define-package "devanagari-inscript" "Devanagari" "DevIS" t "Devanagari keyboard Inscript"))
229 (quail-define-inscript-package
230 indian-dev-base-table inscript-dev-keytable
231 "devanagari-inscript" "Devanagari" "DevIS"
232 "Devanagari keyboard Inscript.")
234 (if nil
235 (quail-define-package "punjabi-inscript" "Punjabi" "PnjIS" t "Punjabi keyboard Inscript"))
236 (quail-define-inscript-package
237 indian-pnj-base-table inscript-dev-keytable
238 "punjabi-inscript" "Punjabi" "PnjIS"
239 "Punjabi keyboard Inscript.")
241 (if nil
242 (quail-define-package "gujarati-inscript" "Gujarati" "GjrIS" t "Gujarati keyboard Inscript"))
243 (quail-define-inscript-package
244 indian-gjr-base-table inscript-dev-keytable
245 "gujarati-inscript" "Gujarati" "GjrIS"
246 "Gujarati keyboard Inscript.")
248 (if nil
249 (quail-define-package "oriya-inscript" "Oriya" "OriIS" t "Oriya keyboard Inscript"))
250 (quail-define-inscript-package
251 indian-ori-base-table inscript-dev-keytable
252 "oriya-inscript" "Oriya" "OriIS"
253 "Oriya keyboard Inscript.")
255 (if nil
256 (quail-define-package "bengali-inscript" "Bengali" "BngIS" t "Bengali keyboard Inscript"))
257 (quail-define-inscript-package
258 indian-bng-base-table inscript-dev-keytable
259 "bengali-inscript" "Bengali" "BngIS"
260 "Bengali keyboard Inscript.")
262 (if nil
263 (quail-define-package "assamese-inscript" "Assamese" "AsmIS" t "Assamese keyboard Inscript"))
264 (quail-define-inscript-package
265 indian-asm-base-table inscript-dev-keytable
266 "assamese-inscript" "Assamese" "AsmIS"
267 "Assamese keyboard Inscript.")
269 (if nil
270 (quail-define-package "telugu-inscript" "Telugu" "TlgIS" t "Telugu keyboard Inscript"))
271 (quail-define-inscript-package
272 indian-dev-base-table inscript-dev-keytable
273 "telugu-inscript" "Telugu" "TlgIS"
274 "Telugu keyboard Inscript.")
276 (if nil
277 (quail-define-package "kannada-inscript" "Kannada" "KndIS" t "Kannada keyboard Inscript"))
278 (quail-define-inscript-package
279 indian-knd-base-table inscript-dev-keytable
280 "kannada-inscript" "Kannada" "KndIS"
281 "Kannada keyboard Inscript.")
283 (if nil
284 (quail-define-package "malayalam-inscript" "Malayalam" "MlmIS" t "Malayalam keyboard Inscript"))
285 (quail-define-inscript-package
286 indian-mlm-base-table inscript-mlm-keytable
287 "malayalam-inscript" "Malayalam" "MlmIS"
288 "Malayalam keyboard Inscript.")
290 (if nil
291 (quail-define-package "tamil-inscript" "Tamil" "TmlIS" t "Tamil keyboard Inscript"))
292 (quail-define-inscript-package
293 indian-tml-base-table inscript-tml-keytable
294 "tamil-inscript" "Tamil" "TmlIS"
295 "Tamil keyboard Inscript.")
297 ;; arch-tag: 9e5a621e-f7d5-4fce-9543-0a51b407c940
298 ;;; indian.el ends here