Deleted because of redundancy
[m17n/m17n-contrib.git] / im / te-rts.mim
1 ;; te-rts.mim -- Telugu input method with RTS method
2
3 ;; Copyright (C) 2003, 2004, 2005, 2006
4 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
5 ;;   Registration Number H15PRO112
6 ;; Copyright 2005, 2006 Suraj N. Kurapati <skurapat@ucsc.edu>
7 ;; Copyright 2006 Chaitanya Kamisetty <chaitanya@atc.tcs.co.in>
8
9
10 ;; This file is part of the m17n contrib; a sub-part of the m17n
11 ;; library.
12
13 ;; The m17n library is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU Lesser General Public License
15 ;; as published by the Free Software Foundation; either version 2.1 of
16 ;; the License, or (at your option) any later version.
17
18 ;; The m17n library is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 ;; Lesser General Public License for more details.
22
23 ;; You should have received a copy of the GNU Lesser General Public
24 ;; License along with the m17n library; if not, write to the Free
25 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, USA.
27
28
29
30 (input-method te rts)
31
32 (description "Input method for Telugu script with RTS method.
33 For the detail of RTS, see the page:
34   <http://groups.google.com/groups?selm=Bv0A9M.27B%40rice.edu&output=gplain>.
35
36 This input method is based upon the Telugu Rice Transliteration
37 Standard (RTS) specification and its Rice Inverse
38 Transliterator (RIT) supplement.
39
40 The original RTS specification was written by Ananda Kishore and
41 Rama Rao Kanneganti in 1992 and can presently be accessed in the
42 \"soc.culture.indian.telugu\" newsgroup archives (see
43 <http://groups.google.com/groups?selm=Bv0A9M.27B\%40rice.edu&output=gplain>).
44
45 The RIT supplement adds alternative combinations for
46 transliteration but, in general, does not distract from the
47 original specification (see
48 <http://www.teluguworld.org/RIT/rit3.0/manual.html>). Whenever a
49 supplemental combination conflicts with the original RTS, the RTS
50 version has precedence and the supplemental combination is
51 disregarded (such as 'ea' from RIT 3.0).
52
53 Finally, this input method deviates slightly from the RTS in the
54 following ways:
55
56         (1) The combinations \"\@n\", \"\@2\", \"~c\", and \"~j\"
57             yield \"�\" because their corresponding glyphs do not
58             yet exist in Telugu's Unicode chart.
59
60        (2) If it appears at the end of a word, the combination
61             \"m\" yields \"ం\". The user can type \"m&\" to
62             bypass this behavior and force \"m\" to yield \"మ్\".
63 ")
64
65 (title "క")
66
67 (map
68  (starter
69   ((S-\ )) ((C-@))      ; m17n stuff
70
71   ("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h") ("i") ("j")
72   ("k") ("l") ("m") ("n") ("o") ("p") ("r") ("s") ("t") ("u")
73   ("v") ("w") ("x") ("y") ("z")
74
75   ("A") ("B") ("C") ("D") ("E") ("G") ("H") ("I") ("J") ("K")
76   ("L") ("M") ("N") ("O") ("P") ("R") ("S") ("T") ("U") ("V")
77   ("W")
78
79   ("0") ("1") ("2") ("3") ("4") ("5") ("6") ("7") ("8") ("9")
80
81   ("@") ("|") ("~")
82
83   ("#") ("_")
84  )
85
86
87
88  ; these consonants undergo automatic sunna generation
89  (consonant
90
91   ; row 1
92   ("k" "క్")
93
94   ("kh" "ఖ్")
95   ("kH" "ఖ్")
96   ("K" "ఖ్")
97   ("Kh" "ఖ్")
98   ("KH" "ఖ్")
99
100   ("g" "గ్")
101
102   ("gh" "ఘ్")
103   ("gH" "ఘ్")
104   ("G" "ఘ్")
105   ("Gh" "ఘ్")
106   ("GH" "ఘ్")
107
108
109   ; row 2
110   ("c" "చ్")
111   ("ch" "చ్")
112   ("cH" "చ్")
113   
114   ("~c" "�")  ; త్స (tsa) allophone of చ (cha)
115
116   ("C" "ఛ్")
117   ("Ch" "ఛ్")
118   ("CH" "ఛ్")
119   ("c'" "ఛ్")       ; from RIT 2.0, 3.0
120
121   ("j" "జ్")
122   ("z" "జ్")        ; from RIT 3.0
123
124   ("~j" "�")  ; డ్జ (dza) allophone of జ (ja)
125
126   ("jh" "ఝ్")
127   ("jH" "ఝ్")
128   ("J" "ఝ్")
129   ("Jh" "ఝ్")
130   ("JH" "ఝ్")
131
132
133   ; row 3
134   ("T" "ట్")
135   ("t'" "ట్")
136
137   ("Th" "ఠ్")
138   ("TH" "ఠ్")
139   ("th'" "ఠ్")
140   ("tH'" "ఠ్")
141
142   ("D" "డ్")
143   ("d'" "డ్")
144
145   ("Dh" "ఢ్")
146   ("DH" "ఢ్")
147   ("dh'" "ఢ్")
148   ("dH'" "ఢ్")
149
150
151   ; row 4
152   ("t" "త్")
153
154   ("th" "థ్")
155   ("tH" "థ్")
156
157   ("d" "ద్")
158
159   ("dh" "ధ్")
160   ("dH" "ధ్")
161
162
163   ; row 5
164   ("p" "ప్")
165
166   ("f" "ఫ్")
167   ("P" "ఫ్")
168   ("ph" "ఫ్")
169   ("pH" "ఫ్")
170   ("Ph" "ఫ్")
171   ("PH" "ఫ్")
172
173   ("b" "బ్")
174
175   ("bh" "భ్")
176   ("bH" "భ్")
177   ("B" "భ్")
178   ("Bh" "భ్")
179   ("BH" "భ్")
180
181
182   ; row 6
183   ("l" "ల్")
184
185   ("v" "వ్")
186   ("V" "వ్")        ; from RIT 3.0
187   ("w" "వ్")
188   ("W" "వ్")        ; from RIT 3.0
189
190   ("S" "శ్")
191   ("s'" "శ్")       ; from RIT 2.0, 3.0
192
193   ("s" "స్")
194
195
196   ("x" "క్ష్")
197   ("ksh" "క్ష్")
198   ("ksH" "క్ష్")
199   ("ks" "క్స్") ; workaround for inputting "క్స్"
200
201
202   ; misc. compounds
203   ("dd'" "డ్డ్")  ; from RIT 3.0
204   ("dd" "ద్ద్")
205
206   ("tt'" "ట్ట్")  ; from RIT 3.0
207   ("tt" "త్త్")
208
209   ("jn" "జ్ఞ్")
210  )
211
212
213
214  ; these consonants do NOT undergo automatic sunna generation
215  (consonant2
216   ("~m" "ఙ్")
217
218   ("~n" "ఞ్")
219
220   ("N" "ణ్")
221   ("nh" "ణ్")
222   ("nH" "ణ్")
223   ("n'" "ణ్")       ; from RIT 2.0, 3.0
224
225   ("n&" "న్")
226
227   ("m&" "మ్")
228
229   ("y" "య్")
230
231   ("r" "ర్")
232
233   ("sh" "ష్")
234   ("sH" "ష్")
235   ("Sh" "ష్")       ; from RIT 3.0
236   ("SH" "ష్")       ; from RIT 3.0
237
238   ("h" "హ్")
239   ("H" "హ్")
240
241   ("L" "ళ్")
242   ("lh" "ళ్")
243   ("lH" "ళ్")
244   ("Lh" "ళ్")
245   ("LH" "ళ్")
246   ("l'" "ళ్")       ; from RIT 2.0, 3.0
247
248   ("~r" "ఱ్")
249   ("r''" "ఱ్")      ; from RIT 2.0, 3.0
250  )
251
252
253
254  ; these consonants are converted into sunna by the automatic sunna generation logic, if they appear inside a word
255  (sunna-inside-word
256   ("n" "న్")
257
258   ("m" "మ్")
259  )
260
261
262
263  ; these sequences are converted into sunna by the automatic sunna generation logic, if they appear at the end of a word
264  (sunna-endof-word
265   ((m Tab) "ం ")
266   ((m Return) "ం")
267
268
269   ; the sequences below, using punctuation marks to denote the end of a word, are generated by the following shell command. keys in [1] the (starter) block, [2] the (independent) block, and [3] those which begin with the 'm' key are intentionally excluded from this command to ensure that they are transliterated normally.
270   ; for ch in ' ' '!' '\"' '#' '$' '%' "'" '(' ')' '*' '+' ',' '-' '.' '/' '\\' ':' ';' '<' '=' '>' '?' '[' ']' '_' '`' '{' '}'; do echo "  (\"m${ch}\" \"ం${ch}\")"; done # exclude '^' '&' '|' '@' '~'
271   ("m " "ం ")
272   ("m!" "ం!")
273   ("m\"" "ం\"")
274   ("m#" "ం#")
275   ("m$" "ం$")
276   ("m%" "ం%")
277   ("m'" "ం'")
278   ("m(" "ం(")
279   ("m)" "ం)")
280   ("m*" "ం*")
281   ("m+" "ం+")
282   ("m," "ం,")
283   ("m-" "ం-")
284   ("m." "ం.")
285   ("m/" "ం/")
286   ("m\\" "ం\\")
287   ("m:" "ం:")
288   ("m;" "ం;")
289   ("m<" "ం<")
290   ("m=" "ం=")
291   ("m>" "ం>")
292   ("m?" "ం?")
293   ("m[" "ం[")
294   ("m]" "ం]")
295   ("m_" "ం_")
296   ("m`" "ం`")
297   ("m{" "ం{")
298   ("m}" "ం}")
299  )
300
301
302
303  (independent
304
305   ; అచ్చులు (vowels)
306   ("a" "అ")
307
308   ("aa" "ఆ")
309   ("a'" "ఆ")
310   ("A" "ఆ")   ; from RIT 2.0, 3.0
311
312   ("i" "ఇ")
313
314   ("ee" "ఈ")
315   ("ii" "ఈ")
316   ("ia" "ఈ")
317   ("i'" "ఈ")
318   ("I" "ఈ")   ; from RIT 2.0, 3.0
319
320   ("u" "ఉ")
321
322   ("oo" "ఊ")
323   ("uu" "ఊ")
324   ("U" "ఊ")
325   ("ua" "ఊ")
326   ("u'" "ఊ")
327
328   ("R" "ఋ")
329   ("r'" "ఋ")  ; from RIT 2.0
330
331   ("Ru" "ౠ")
332   ("r'u" "ౠ") ; from RIT 2.0
333
334   ("~l" "ఌ")
335
336   ("~L" "ౡ")
337
338   ("e" "ఎ")
339
340   ("ea" "ఏ")
341   ("ae" "ఏ")
342   ("E" "ఏ")
343   ("e'" "ఏ")
344
345   ("ai" "ఐ")
346   ("ei" "ఐ")  ; from RIT 3.0
347
348   ("o" "ఒ")
349
350   ("oe" "ఓ")
351   ("O" "ఓ")
352   ("oa" "ఓ")
353   ("o'" "ఓ")
354
355   ("au" "ఔ")
356   ("ou" "ఔ")
357   ("ow" "ఔ")  ; from RIT 3.0
358
359
360   ; అంకెలు (numbers)
361   ("0" "౦")
362   ("1" "౧")
363   ("2" "౨")
364   ("3" "౩")
365   ("4" "౪")
366   ("5" "౫")
367   ("6" "౬")
368   ("7" "౭")
369   ("8" "౮")
370   ("9" "౯")
371
372
373   ; punctuation
374   ("|" "।")   ; from RIT 3.0
375   ("||" "॥")  ; from Yudit
376
377
378   ; additional modifiers
379   ("M" "ం")   ; from "internal representation" section of RTS. This combination has been included because it is very widely used in RTS implementations which do not support automatic sunna generation and thus has become the defacto way of manually producing sunna.
380
381   ("@M" "ఁ")  ; అర్ధసున్న (ardhasunna), చంద్ర బిందు (chandra bindu)
382   ("@m" "ఁ")  ; from RIT 3.0
383
384   ("@h" "ః")  ; విసర్గ  (visarga)
385   ("@H" "ః")
386
387   ("@n" "�")  ; నకర పొల్లు  (nakara-pollu), నకర విరమ (nakara-virama)
388   ("@N" "�")  ; from RIT 3.0
389
390   ("@2" "�")  ; అవగ్రహ  (avagraha)
391
392   ("^" "్‌")        ; పొల్లు (pollu), విరమ (virama), halant
393
394   ("_" "")  ; ignored according to RTS
395
396
397   ; m17n stuff
398   ((S-\ ) "‌")
399   ((C-@) "‍")
400  )
401
402
403
404  (dependent
405   ("a" (delete @-) "")
406
407   ("aa" (delete @-) "ా")
408   ("a'" (delete @-) "ా")
409   ("A" (delete @-) "ా")       ; from RIT 3.0
410
411   ("i" (delete @-) "ి")
412
413   ("ee" (delete @-) "ీ")
414   ("ii" (delete @-) "ీ")
415   ("ia" (delete @-) "ీ")
416   ("i'" (delete @-) "ీ")
417   ("I" (delete @-) "ీ")       ; from RIT 3.0
418
419   ("u" (delete @-) "ు")
420
421   ("oo" (delete @-) "ూ")
422   ("uu" (delete @-) "ూ")
423   ("U" (delete @-) "ూ")
424   ("ua" (delete @-) "ూ")
425   ("u'" (delete @-) "ూ")
426
427   ("R" (delete @-) "ృ")
428   ("r'" (delete @-) "ృ")      ; from RIT 2.0
429
430   ("Ru" (delete @-) "ౄ")
431   ("r'u" (delete @-) "ౄ")     ; from RIT 2.0
432
433   ("~l" (delete @-) "")
434
435   ("~L" (delete @-) "")
436
437   ("e" (delete @-) "ె")
438
439   ("ea" (delete @-) "ే")
440   ("ae" (delete @-) "ే")
441   ("E" (delete @-) "ే")
442   ("e'" (delete @-) "ే")
443
444   ("ai" (delete @-) "ై")
445   ("ei" (delete @-) "ై")      ; from RIT 3.0
446
447   ("o" (delete @-) "ొ")
448
449   ("oe" (delete @-) "ో")
450   ("O" (delete @-) "ో")
451   ("oa" (delete @-) "ో")
452   ("o'" (delete @-) "ో")
453
454   ("au" (delete @-) "ౌ")
455   ("ou" (delete @-) "ౌ")
456   ("ow" (delete @-) "ౌ")      ; from RIT 3.0
457
458
459   ; additional modifiers
460   ("^" (delete @-) "్‌")    ; పొల్లు (pollu), విరమ (virama), halant
461  )
462
463 (single_hash
464   ("#" "")
465  )
466
467  (triple_hash
468   ("###" "#")
469  )
470
471   (invariant
472   ("a" "a" ) ("b" "b" ) ("c" "c" ) ("d" "d" ) ("e" "e") ("f" "f") ("g" "g") ("h" "h") ("i" "i") ("j" "j")
473   ("k" "k" ) ("l" "l" ) ("m" "m" ) ("n" "n" ) ("o" "o" ) ("p" "p" ) ("q" "q") ("r" "r" ) ("s" "s" ) ("t" "t" ) ("u" "u" )
474   ("v" "v" ) ("w" "w" ) ("x" "x" ) ("y" "y" ) ("z" "z" )
475
476   ("A" "A" ) ("B" "B" ) ("C" "C" ) ("D" "D" ) ("E" "E" ) ("F" "F") ("G" "G" ) ("H" "H" ) ("I" "I" ) ("J" "J" ) ("K" "K" )
477   ("L" "L" ) ("M" "M" ) ("N" "N" ) ("O" "O" ) ("P" "P" ) ("Q" "Q") ("R" "R" ) ("S" "S" ) ("T" "T" ) ("U" "U" ) ("V" "V" )
478   ("W" "W" ) ("X" "X" ) ("Y" "Y" ) ("Z" "Z" )
479
480   ("0" "0" ) ("1" "1" ) ("2" "2" ) ("3" "3" ) ("4" "4" ) ("5" "5" ) ("6" "6" ) ("7" "7" ) ("8" "8" ) ("9" "9" )
481
482   ("~" "~") ("`" "`") ("!" "!") ("@" "@" ) ("$" "$") ("%" "%") ("^" "^") ("&" "&") ("*" "*") ("(" "(") (")" ")") ("_" "_")
483   ("-" "-") ("+" "+") ("=" "=") ("{" "{") ("[" "[") ("}" "}") ("]" "]") ("|" "|" ) ("\\" "\\") (":" ":") (";" ";")
484   ("\"" "\"") ("\'" "\'") ("<" "<") ("," ",") (">" ">") ("." ".") ("?" "?") ("/" "/")
485
486   (" " " ") ((Tab) ("\t")) ((BackSpace) (undo)) ((Return) ("\n"))
487   )
488
489  ; m17n stuff
490  (return
491   ((Return)))
492
493  (backspace
494   ((BackSpace) (undo)))
495 )
496
497
498
499 ; state machine for transliteration
500 (state
501  (init
502   (starter (pushback 1) (shift intermediate))
503  )
504
505  (intermediate
506   (consonant (shift second))
507   (consonant2 (shift second))
508   (sunna-inside-word (shift second-sunna-inside-word))
509   (sunna-endof-word (shift init))
510   (independent (shift init))
511   (single_hash (shift no_transliteration))
512   (triple_hash (shift init))
513   (backspace)
514   (return (shift init))
515  )
516
517  (second
518   (consonant)
519   (consonant2)
520   (sunna-inside-word (shift second-sunna-inside-word))
521   (sunna-endof-word (shift init))
522   (dependent (shift init))
523   (backspace)
524   (return (shift init))
525  )
526
527  (second-sunna-inside-word
528   (t (mark p))
529   (consonant (move p) (delete @-) (delete @-) "ం" (move @>) (shift second))
530   (consonant2 (shift second))
531   (sunna-inside-word)
532   (sunna-endof-word (shift init))
533   (dependent (shift init))
534   (backspace)
535  )
536
537  (no_transliteration
538   (single_hash (shift init))
539   (invariant)
540  )
541 )
542
543 ;; Local Variables:
544 ;; coding: utf-8
545 ;; mode: emacs-lisp
546 ;; End: