-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ks-sharada-itrans.mim
329 lines (302 loc) ยท 9.5 KB
/
ks-sharada-itrans.mim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
;; ks-sharada-itrans.mim -- Kashmiri sharada input method by ITRANS and Harvard-Kyoto transliteration systems.
;; Copyright (C) 2023 Vishvas Vasuki <vishvas.vasuki@gmail.com>
;; This file is part of the m17n database; a sub-part of the m17n
;; library.
;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.
;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Lesser General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>
(input-method ks sharada-itrans)
(description "Kashmiri sharada input method by ITRANS and Harvard-Kyoto
transliteration systems.
You can use all the standard ITRANS key sequences plus key
sequences such as the below.
nk->๐๐๐๐, nkh->๐๐๐๐, ng->๐๐๐๐, ngh->๐๐๐๐
nch->๐๐๐๐, nCh->๐๐๐๐, nc->๐๐๐๐, nC->๐๐๐๐, nchh->๐๐๐๐,
nj->๐๐๐๐, njh->๐๐๐๐, nT->๐๐๐๐, nTh->๐๐๐๐, nD->๐๐๐๐, nDh->๐๐๐๐
c->๐๐, C->๐๐, z->๐ฏ๐, S->๐ฐ๐, jn->๐๐๐๐, R->๐
In addition, for convenience, when a consonant + halant sequence
is followed by non Devanagari letter, the last halant is removed.
For instance, 'k SPC'->'๐ ', 'k..'->'๐๐
'.
The motivation behind additions made to the basic ITRANS scheme
is described in https://sanskrit-coders.github.io/input/optitrans/,
along with a tabulated comparison with several other
transliteration schemes.
Also, see: http://en.wikipedia.org/wiki/Devanagari_transliteration.")
(title "๐")
(variable
(trim-last-halant
(_"If this variable is 1 (the default), the last Halant in a syllable
is removed if it is followed by non Devanagari letter. For instance,
typing \"har..\" produces \"๐ฒ๐ซ๐
\", not \"๐ฒ๐ซ๐๐
\".")
1 0 1))
(map
(starter
(".") ("~") ("#") ("$") ("*") ("]") ((C-@))
("0") ("1") ("2") ("3") ("4") ("5") ("6") ("7") ("8") ("9")
("A") ("C") ("D") ("E") ("G") ("H") ("I") ("J") ("K") ("L")
("M") ("N") ("O") ("R") ("S") ("T") ("U") ("Y")
("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h") ("i")
("j") ("k") ("l") ("m") ("n") ("o") ("p") ("q") ("r")
("s") ("t") ("u") ("v") ("w") ("x") ("y") ("z")
((KP_1)) ((KP_2)) ((KP_3)) ((KP_4)) ((KP_5))
((KP_6)) ((KP_7)) ((KP_8)) ((KP_9)) ((KP_0)))
(consonant
("k" "๐๐")
("kh" "๐๐")
("K" "๐๐")
("g" "๐๐")
("gh" "๐๐")
("G" "๐๐")
(".k" "๐๐๐ ")
("q" "๐๐๐")
(".kh" "๐๐๐")
(".K" "๐๐๐")
(".g" "๐๐๐")
("nk" "๐๐๐๐")
("nx" "๐๐๐๐๐ฐ๐")
("nkh" "๐๐๐๐")
("nK" "๐๐๐๐")
("ng" "๐๐๐๐")
("ngh" "๐๐๐๐")
("nG" "๐๐๐๐")
("~N" "๐๐")
("N^" "๐๐")
("ch" "๐๐")
("Ch" "๐๐") ; not in ITRANS Devanagari table
("c" "๐๐")
("C" "๐๐") ; not in ITRANS Devanagari table
("chh" "๐๐")
("j" "๐๐")
("jh" "๐๐")
("J" "๐๐")
("nch" "๐๐๐๐")
("nCh" "๐๐๐๐") ; not in ITRANS Devanagari table
("nc" "๐๐๐๐")
("nC" "๐๐๐๐") ; not in ITRANS Devanagari table
("nchh" "๐๐๐๐")
("nj" "๐๐๐๐")
("njh" "๐๐๐๐")
("nJ" "๐๐๐๐")
("~n" "๐๐")
("JN" "๐๐")
("T" "๐๐")
("Th" "๐๐")
("D" "๐๐")
("Dh" "๐๐")
(".D" "๐๐๐")
(".Dh" "๐๐๐")
("nT" "๐๐๐๐")
("nTh" "๐๐๐๐")
("nD" "๐๐๐๐")
("nDh" "๐๐๐๐")
("N" "๐๐")
("t" "๐ ๐")
("th" "๐ก๐")
("d" "๐ข๐")
("dh" "๐ฃ๐")
("n" "๐ค๐")
(":n" "๐ค๐๐") ; not in ITRANS Devanagari table
("p" "๐ฅ๐")
("ph" "๐ฆ๐")
("P" "๐ฆ๐")
(".ph" "๐ฆ๐๐")
("f" "๐ฆ๐๐")
("b" "๐ง๐")
("bh" "๐จ๐")
("B" "๐จ๐")
("m" "๐ฉ๐")
("y" "๐ช๐")
("Y" "๐ช๐๐") ; not in ITRANS Devanagari table
("yh" "๐ช๐๐") ; not in ITRANS Devanagari table
(".y" "๐ช๐๐")
("r" "๐ซ๐")
("l" "๐ฌ๐")
("L" "๐ญ๐")
("ld" "๐ญ๐")
("v" "๐ฎ๐")
("w" "๐ฎ๐")
("sh" "๐ฏ๐")
("z" "๐๐๐")
(".j" "๐๐๐")
; ("z" "๐ฏ๐")
("S" "๐ฐ๐")
("Sh" "๐ฐ๐")
("shh" "๐ฐ๐")
("s" "๐ฑ๐")
("h" "๐ฒ๐")
("jn" "๐๐๐๐")
("j~n" "๐๐๐๐")
("jn" "๐๐๐๐")
("GY" "๐๐๐๐")
("dny" "๐๐๐๐") ; not in ITRANS Devanagari table
("x" "๐๐๐ฐ๐")
("ks" "๐๐๐ฑ๐")
("ksh" "๐๐๐ฐ๐")
("gH" ๐๐)
("jH" ๐๐)
("DH" "๐๐")
("bH" "๐ง๐"))
(independent
("a" "๐")
("aa" "๐")
("A" "๐")
("i" "๐
")
("ii" "๐")
("I" "๐")
("u" "๐")
("uu" "๐")
("U" "๐")
("R" "๐")
("RRi" "๐")
("R^i" "๐")
("LLi" "๐") ; not in ITRANS Devanagari table
("L^i" "๐") ; not in ITRANS Devanagari table
(".c" "๐๐๐") ; not in ITRANS Devanagari table
("ea" "๐๐๐") ; not in ITRANS Devanagari table
("ee" (set CANDRA-E-O 0) "๐๐") ; not in ITRANS Devanagari table
("E" "๐๐") ; not in ITRANS Devanagari table
("e" (set CANDRA-E-O ?๐๐๐) "๐")
("ai" "๐")
("oo" (set CANDRA-E-O 0) "๐๐") ; not in ITRANS Devanagari table
("O" "๐๐") ; not in ITRANS Devanagari table
("o" (set CANDRA-E-O ?๐๐) "๐")
("oa" "๐๐")
("au" "๐")
("RRI" "๐") ; not in ITRANS Devanagari table
("RR" "๐") ; not in ITRANS Devanagari table
("R^I" "๐") ; not in ITRANS Devanagari table
("LLI" "๐") ; not in ITRANS Devanagari table
("L^I" "๐") ; not in ITRANS Devanagari table
(".N" "๐")
(".n" "๐")
("M" "๐")
("H" "๐")
("kH" "แณต")
("pH" "แณถ")
(".a" "๐")
(".h" "๐")
("AUM" "๐๐")
("OM" "๐๐"))
(digit
("0" "๐")
("1" "๐")
("2" "๐")
("3" "๐")
("4" "๐")
("5" "๐")
("6" "๐")
("7" "๐")
("8" "๐")
("9" "๐")
((KP_0) "๐")
((KP_1) "๐")
((KP_2) "๐")
((KP_3) "๐")
((KP_4) "๐")
((KP_5) "๐")
((KP_6) "๐")
((KP_7) "๐")
((KP_8) "๐")
((KP_9) "๐"))
(dependent
("a" (delete @-) "")
("aa" (delete @-) "๐ณ")
("A" (delete @-) "๐ณ")
("i" (delete @-) "๐ด")
("ii" (delete @-) "๐ต")
("I" (delete @-) "๐ต")
("u" (delete @-) "๐ถ")
("uu" (delete @-) "๐ท")
("U" (delete @-) "๐ท")
("R" (delete @-) "๐ธ")
("RRi" (delete @-) "๐ธ")
("R^i" (delete @-) "๐ธ")
("LLi" (delete @-) "๐บ") ; not in ITRANS Devanagari table
("L^i" (delete @-) "๐บ") ; not in ITRANS Devanagari table
(".c" (delete @-) "๐ผ๐๐") ; not in ITRANS Devanagari table
("ea" (delete @-) "๐ผ๐๐") ; not in ITRANS Devanagari table
("ee" (delete @-) (set CANDRA-E-O 0) "๐ผ๐") ; not in ITRANS Devanagari table
("E" (delete @-) "๐ผ๐") ; not in ITRANS Devanagari table
("e" (delete @-) (set CANDRA-E-O ?๐ผ๐๐) "๐ผ")
("ai" (delete @-) "๐ฝ")
("oo" (delete @-) (set CANDRA-E-O 0) "๐พ๐") ; not in ITRANS Devanagari table
("O" (delete @-) "๐พ๐") ; not in ITRANS Devanagari table
("o" (delete @-) (set CANDRA-E-O ?๐ณ๐) "๐พ")
("oa" "๐ณ๐")
("au" (delete @-) "๐ฟ")
("RR" (delete @-) "๐น") ; not in ITRANS Devanagari table
("RRI" (delete @-) "๐น") ; not in ITRANS Devanagari table
("R^I" (delete @-) "๐น") ; not in ITRANS Devanagari table
("LLI" (delete @-) "๐ป") ; not in ITRANS Devanagari table
("L^I" (delete @-) "๐ป")) ; not in ITRANS Devanagari table
(dot
("." (set DOT 1) "."))
(eo-dot-c
(".c" (delete @-) (insert CANDRA-E-O)))
(danda
(".." "๐
") ; not in ITRANS Devanagari table
(".," "๐") ; not in ITRANS Devanagari table
(". " "๐
" (pushback 1))
((?. Return) "๐
" (pushback 1))
((?. Tab) "๐
" (pushback 1))
(".(" "๐
" (pushback 1))
(".)" "๐
" (pushback 1))
(".[" "๐
" (pushback 1))
(".]" "๐
" (pushback 1))
(".{" "๐
" (pushback 1))
(".}" "๐
" (pushback 1))
(".'" "๐
" (pushback 1))
(".\"" "๐
" (pushback 1)))
(commit-key
((S-C-Return)))
(backspace
((BackSpace) (undo))))
(state
(init
(starter (pushback 1) (shift intermediate)))
(intermediate
;; CANDRA-E-O is set to the character CANDRA E or CANDRA O when "e"
;; or "o" is typed, and in that case, if ".c" is typed, the
;; character set to CANDRA-E-O is inserted.
(t (set CANDRA-E-O 0))
;; LAST-HALANT-POS is set to the position after a consonat + HALANT
;; sequence. If the following key is for non-letter, that HALANT
;; character is removed.
(consonant (mark LAST-HALANT-POS) (shift second))
(independent (cond (CANDRA-E-O (shift after-eo)) (1 (shift init))))
(digit (shift init))
(danda (shift init))
(backspace)
(commit-key (shift init)))
(second
;; CANDRA-E-O is set to the character CANDRA E or CANDRA O when "e"
;; or "o" is typed, and in that case, if ".c" is typed, the
;; character set to CANDRA-E-O is inserted.
(t (set CANDRA-E-O 0))
(consonant (mark LAST-HALANT-POS))
(dependent (cond (CANDRA-E-O (shift after-eo)) (1 (shift init))))
(danda
(cond (trim-last-halant (move LAST-HALANT-POS) (delete @-) (move @>)))
(shift init))
(backspace)
(commit-key (shift init))
(nil (cond (trim-last-halant (move LAST-HALANT-POS) (delete @-) (move @>)))
(shift init)))
(after-eo
(t (set DOT 0))
(dot)
(eo-dot-c (shift init))
(danda (shift init))
(commit-key (shift init))
(nil (cond (DOT (delete @-) (pushback 1))) (shift init))))
;; Local Variables:
;; coding: utf-8
;; mode: emacs-lisp
;; End: