BUGFIX: MJ -> My, A-n J -> A-n y
[m17n/m17n-contrib.git] / im / te-apple.mim
1 ;;
2 ;;        Input Method for Telugu Apple Keyboard Layout
3 ;;
4 ;;    Copyright (c) 2006, Chaitanya Kamisetty <chaitanya@atc.tcs.co.in>
5 ;;
6 ;;    This file is part of the m17n contrib; a sub-part of the m17n
7 ;;    library.
8 ;;
9 ;;    This library is free software; you can redistribute it and/or
10 ;;    modify it under the terms of the GNU Lesser General Public
11 ;;    License as published by the Free Software Foundation; either
12 ;;    version 2.1 of the License, or (at your option) any later version.
13 ;;
14 ;;    This library is distributed in the hope that it will be useful,
15 ;;    but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;;    Lesser General Public License for more details.
18 ;;
19 ;;    You should have received a copy of the GNU Lesser General Public
20 ;;    License along with this library; if not, write to the Free Software
21 ;;    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 ;;
23
24 (input-method te apple)
25
26 (description "Apple keyboard layout for Telugu")
27
28 (title "తెలుగు")
29
30 (map
31    (independent
32         ("0" "0")
33         ("1" "1")
34         ("2" "2")
35         ("3" "3")
36         ("4" "4")
37         ("5" "5")
38         ("6" "6")
39         ("7" "7")
40         ("8" "8")
41         ("9" "9")
42         ("@" "'")
43         ("#" "%")
44         ("\$"   "్పు")
45         ("%"    "్ర")
46         ("^" "-")
47         ("&" "|")
48         ("*" "`")
49         ("(" "(")
50         (")" ")")
51         ("-" "×")
52         ("_" "÷")
53         ("=" "=")
54         ("+" "+")
55         ("\\" "ః")
56         ("|" "ఁ")
57         ("}" "!")
58         ("I" "/")
59         ("<" ";")
60         ("." ".")
61         (">" "?")
62         ("g" "ం")
63         ("G" ":")
64         ("Q" "క్ష్మి")
65         ("O" "స్త్ర")
66         ("P" "ష్ట్ర")
67         ("{" "క్ష్మ")
68         ("N" "క్ష్మీ")
69         ("`" "_")
70         ("h" "్")
71         ("H" "్")
72         ("q" "అ")
73         ("e" "ఆ")
74         ("r" "ఇ")
75         ("w" "ఈ")
76         ("i" "ఉ")
77         ("p" "ఊ")
78         ("W" "ఋ")
79         ("E" "ౠ")
80         ("u" "ఎ")
81         ("o" "ఏ")
82         ("[" "ఐ")
83         ("t" "ఒ")
84         ("y" "ఓ")
85         ("]" "ఔ")
86         )
87    (dependent_vowels
88         ("e"    "ా")
89         ("r"    "ి")
90         ("w"    "ీ")
91         ("i"    "ు")
92         ("p"    "ూ")
93         ("W"    "ృ")
94         ("E"    "ౄ")
95         ("u"    "ె")
96         ("o"    "ే")
97         ("["    "ై")
98         ("t"    "ొ ")
99         ("y"    "ో")
100         ("]"    "ౌ")
101         ("H"    "్")
102         )
103
104    (a_matra
105         ("q" "")
106    )
107
108    (consonants
109         ("j" "క")
110         ("J" "ఖ")
111         ("x" "గ")
112         ("X" "ఘ")
113         ("R" "ఙ")
114         ("m" "చ")
115         ("M" "ఛ")
116         ("/" "జ")
117         ("?" "ఝ")
118         ("T" "ఞ")
119         ("z" "ట")
120         ("Z" "ఠ")
121         ("c" "డ")
122         ("C" "ఢ")
123         ("L" "ణ")
124         ("s" "త")
125         ("S" "థ")
126         ("d" "ద")
127         ("D" "ధ")
128         ("l" "న")
129         (";" "ప")
130         (":" "ఫ")
131         ("v" "బ")
132         ("V" "భ")
133         ("b" "మ")
134         ("n" "య")
135         ("k" "ర")
136         ("a" "ల")
137         ("f" "వ")
138         ("F" "శ")
139         ("\"" "ష")
140         ("'" "స")
141         ("B" "హ")
142         ("A" "ళ")
143         ("K" "ఱ")
144         ("Y" "క్ష")
145         ("U" "శ్రీ")
146         )
147
148         ;;consonants occuring after a halant 
149    (halant_consonants
150         ("j" (delete @-) "క")
151         ("J" (delete @-) "ఖ")
152         ("x" (delete @-) "గ")
153         ("X" (delete @-) "ఘ")
154         ("R" (delete @-) "ఙ")
155         ("m" (delete @-) "చ")
156         ("M" (delete @-) "ఛ")
157         ("/" (delete @-) "జ")
158         ("?" (delete @-) "ఝ")
159         ("T" (delete @-) "ఞ")
160         ("z" (delete @-) "ట")
161         ("Z" (delete @-) "ఠ")
162         ("c" (delete @-) "డ")
163         ("C" (delete @-) "ఢ")
164         ("L" (delete @-) "ణ")
165         ("s" (delete @-) "త")
166         ("S" (delete @-) "థ")
167         ("d" (delete @-) "ద")
168         ("D" (delete @-) "ధ")
169         ("l" (delete @-) "న")
170         (":" (delete @-) "ఫ")
171         ("v" (delete @-) "బ")
172         ("V" (delete @-) "భ")
173         ("b" (delete @-) "మ")
174         ("n" (delete @-) "య")
175         ("k" (delete @-) "ర")
176         ("a" (delete @-) "ల")
177         ("f" (delete @-) "వ")
178         ("F" (delete @-) "శ")
179         ("\"" (delete @-)  "ష")
180         ("'" (delete @-) "స")
181         ("B" (delete @-) "హ")
182         ("A" (delete @-) "ళ")
183         ("K" (delete @-) "ఱ")
184         ("Y" (delete @-) "క్ష")
185         ("U" (delete @-) "శ్రీ")
186    )
187
188    ;; halant occuring after a dependent vowel
189    (halant_after_vowel
190         ("h" (delete @-) "్" )
191         ("H" (delete @-) "్" )
192    )
193
194    (halant
195         ("h" "్" )
196         ("H" "్" )
197    )
198
199  ; m17n stuff
200  (return
201   ((Return)))
202
203   (backspace
204   ((BackSpace) (undo)))
205 )
206
207 (state
208     (init (consonants (shift first))
209           (independent)
210     )
211     (first 
212         (a_matra (shift second_a))
213         (dependent_vowels (set current_vowel @-) (shift second_b))
214         (halant (shift third_a))
215         (backspace)
216     )
217     ;;consonat+a matra  
218     (second_a
219         (halant (shift third_a))
220         (backspace)
221     )
222     ;;state when consonant+dependent vowel occurs
223     (second_b
224         ;;move the dependent vowel to the end and add halant to the base consonant
225         (halant_after_vowel (insert current_vowel) (shift fourth))
226         (consonants (set current_vowel 0) (shift first))
227         (backspace)
228     )
229     ;;consonant when followed by halant
230     (third_a
231         (consonants (shift third_b))
232         (backspace)
233     )   
234     ;;state when cosonant+halant+consonant occurs
235     ;;further composition of halant+consonant is achieved with third_a and third_b states
236     ;;this is required as dependent and independent vowels have same keys and have to be
237     ;;identified  by the context 
238     (third_b
239         (halant (shift third_a))
240         (consonants (shift first))
241         (backspace)
242     )   
243     (fourth 
244         ;;delete the dependent vowel and add at the end after the consonant
245         (halant_consonants (insert current_vowel) (shift second_b))
246         (backspace)
247     )
248 )