Fix typo in key string: ">" -> ")".
[m17n/m17n-db.git] / MIM / si-wijesekera-preedit.mim
1 ;; si-wijesekera-preedit.mim -- Sinhala input method with wijesekera method
2 ;; Copyright (C) 2006, 2007
3 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
4 ;;   Registration Number H15PRO112
5
6 ;; This file is part of the m17n database; a sub-part of the m17n
7 ;; library.
8
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
13
14 ;; The m17n 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 the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
23
24 (input-method si wijesekera-preedit)
25
26 (description "Sinhala input method based on SLS 1134 Rev. 2:2004.
27   <http://www.fonts.lk/doc/sin-kbd-layout4.pdf>
28 This input method uses preedit rather than surrounding text.
29 ")
30
31 (title "සි")
32
33 (map
34  (independent
35   ("w" "අ")                           ; 0D85
36   ("b" "ඉ")                           ; 0D89
37   ("B" "ඊ")                           ; 0D8A
38   ("W" "උ")                           ; 0D8B
39   ("R" "ඍ")                           ; 0D8D
40   ((A-,) "ඏ")                         ; 0D8F
41   ("t" "එ")                           ; 0D91
42   ("T" "ඔ")                           ; 0D94
43   ("l" "ක")                           ; 0D9A
44   ("L" "ඛ")                           ; 0D9B
45   ("." "ග")                           ; 0D9C
46   (">" "ඝ")                           ; 0D9D
47   ("X" "ඞ")                           ; 0D9E
48   ((A-.) "ඟ") ((0x2E A-z) "ඟ")              ; 0D9F
49   ("p" "ච")                           ; 0DA0
50   ("P" "ඡ")                           ; 0DA1
51   ("c" "ජ")                           ; 0DA2
52   ("C" "ඣ")                           ; 0DA3
53   ("\[" "ඤ")                          ; 0DA4
54   ("{" "ඥ")                           ; 0DA5
55   ((A-c) "ඦ") ((0x63 A-z) "ඦ")              ; 0DA6
56   ("g" "ට")                           ; 0DA7
57   ("G" "ඨ")                           ; 0DA8
58   ("v" "ඩ")                           ; 0DA9
59   ("V" "ඪ")                           ; 0DAA
60   ("K" "ණ")                           ; 0DAB
61   ((A-v) "ඬ") ((0x76 A-z) "ඬ")              ; 0DAC
62   (";" "ත")                           ; 0DAD
63   (":" "ථ")                           ; 0DAE
64   ("o" "ද")                           ; 0DAF
65   ("O" "ධ")                           ; 0DB0
66   ("k" "න")                           ; 0DB1
67   ((A-o) "ඳ") ((0x6F A-z) "ඳ")              ; 0DB3
68   ("m" "ප")                           ; 0DB4
69   ("M" "ඵ")                           ; 0DB5
70   ("n" "බ")                           ; 0DB6
71   ("N" "භ")                           ; 0DB7
72   ("u" "ම")                           ; 0DB8
73   ("U" "ඹ")                           ; 0DB9
74   ("h" "ය")                           ; 0DBA
75   ("r" "ර")                           ; 0DBB
76   ("," "ල")                           ; 0DBD
77   ("j" "ව")                           ; 0DC0
78   ("Y" "ශ")                           ; 0DC1
79   ("I" "ෂ")                           ; 0DC2
80   ("i" "ස")                           ; 0DC3
81   ("y" "හ")                           ; 0DC4
82   ("<" "ළ")                           ; 0DC5
83   ("F" "ෆ")                           ; 0DC6
84   ((A-') "෴")                         ; 0DF4
85
86   ("J" "ළු")                                ; muurdhaja lu (0DC5 0DD4)
87
88   ((S-\ ) " ")                         ; NBSP (00A0)
89   ((A-\ ) "‌")                                ; ZWNJ (200C)
90
91   ("\]" ";")
92   ("}" ":")
93   ("'" ".")
94   ("\"" ",")
95   ("z" "'")
96   ("Z" "\"")
97   )
98
99  (dependent
100   ("x" "ං")                           ; 0D82
101   ((A-x) "ඃ")                         ; 0D83
102   ("a"
103    (cond
104     ((= @- 0x0D91) (delete @-) "ඒ")   ; 0D92
105     ((= @- 0x0D94) (delete @-) "ඕ")   ; 0D95
106     ((= @- 0x0DD9) (delete @-) "ේ")   ; 0DDA
107     ((= @- 0x0DDC) (delete @-) "ෝ")   ; 0DDD
108     (1 "්")))                         ; 0DCA
109   ("d"
110    (cond
111     ((= @- 0x0D85) (delete @-) "ආ")   ; 0D86
112     ((= @- 0x0DD9) (delete @-) "ො")   ; 0DDC
113     (1 "ා")))                         ; 0DCF
114   ("e"
115    (cond
116     ((= @- 0x0D85) (delete @-) "ඇ")   ; 0D87
117     (1 "ැ")))                         ; 0DD0
118   ("E"
119    (cond
120     ((= @- 0x0D85) (delete @-) "ඈ")   ; 0D88
121     ((& (= @-2 0x0DC5) (= @- 0x0DD4))
122      (delete @-) "ූ")                 ; 0DD6
123     (1 "ෑ")))                         ; 0DD1
124   ("s" "ි")                           ; 0DD2
125   ("S" "ී")                           ; 0DD3
126   ("q" "ු")                           ; 0DD4
127   ("Q" "ූ")                           ; 0DD6
128
129   ("D"
130    (cond
131     ((= @- 0x0D8D) (delete @-) "ඎ")   ; 0D8E
132 ;; The following line does not work when no consonant proceeds.
133 ;;    ((= @- 0x0DD8) (delete @-) "ෲ") ; 0DF2
134     (1 "ෘ")))                         ; 0DD8
135 ;; This one works with or without a preceeding consonant.
136   ("DD" "ෲ")                          ; 0DF2
137
138   ("A"
139    (cond
140     ((= @- 0x0D8B) (delete @-) "ඌ")   ; 0D8C
141     ((= @- 0x0D8F) (delete @-) "ඐ")   ; 0D90
142     ((= @- 0x0D94) (delete @-) "ඖ")   ; 0D96
143     ((= @- 0x0DD9) (delete @-) "ෞ")   ; 0DDE
144     (1 "ෟ")))                         ; 0DDF
145   ((A-a) "ෳ")                         ; 0DF3
146
147   ("H"                                  ; yansaya (0DCA 200D 0DBA)
148    (cond
149     ((| (= @- 0x0DD9) (= @- 0x0DDB))
150      (move @-) "්‍ය" (move @>))
151     (1
152      "්‍ය")))
153
154   ("`"                                  ; rakaransaya (0DCA 200D 0DBB)
155    (cond
156     ((| (= @- 0x0DD2) (= @- 0x0DD3) (= @- 0x0DD9) (= @- 0x0DDB))
157      (move @-) "්‍ර" (move @>))
158     (1 "්‍ර")))
159
160   ("~"                                  ; repaya (0DBB 0DCA 200D)
161    (move @<)
162    "ර්‍"
163    (move @>))
164   )
165
166  (kombuva
167   ("f" "ෙ"))                          ; 0DD9
168
169  (join
170   ("\\"))
171
172  (backspace
173   ((BackSpace)))
174  )
175
176 (state
177  (init-state
178   (independent
179    (shift independent-state))
180   (kombuva
181    (shift kombuva-state))
182   (dependent))
183
184  (independent-state
185   (dependent)
186   (join
187    (cond
188     ((| (= @- 0x0DD9) (= @- 0x0DDB))
189      (shift join-state))
190     ((| (< @- 0x0D9A) (> @- 0x0DC6))
191      (undo -1))
192     (1
193      (shift join-state))))
194   (backspace
195    (undo)))
196
197  (join-state
198   (t
199    (mark p))
200   (independent
201    (move p)
202    (set c @-)
203    (cond
204     ((| (= c 0x0DD9) (= c 0x0DDB))
205      (delete @-)
206      "්‍"                           ; 0DCA 200D
207      (move @>)
208      (insert c))
209     (1
210      "්‍"                           ; 0DCA 200D
211      (move @>)))
212    (shift independent-state))
213   (backspace
214    (undo)))
215
216  (kombuva-state
217   (t
218    (mark p))
219   (independent
220    (cond
221     ((& (= @0 0x0DD9) (= @1 0x0D91))
222      (delete @<)
223      "ඓ"                              ; 0D93
224      (shift independent-state))
225     ((& (= @0 0x0DD9) (< @2 0))
226      (move @0)
227      (delete @+)
228      (move @>)
229      "ෙ"                              ; 0DD9
230      (shift independent-state))
231     ((& (= @0 0x0DDB) (< @2 0))
232      (move @0)
233      (delete @+)
234      (move @>)
235      "ෛ"                              ; 0DDB
236      (shift independent-state))
237     (1
238      (delete p)
239      (pushback 1)
240      (shift init-state))))
241   (kombuva
242    (mark p)
243    (cond
244     ((& (= @0 0x0DD9) (< @2 0))
245      (delete @<)
246      "ෛ")                             ; 0DDB
247     (1
248      (delete @-)
249      (pushback 1)
250      (shift init-state))))
251   (dependent
252    (mark p))
253   (backspace
254    (undo))))
255
256 ;; Local Variables:
257 ;; coding: utf-8
258 ;; mode: emacs-lisp
259 ;; End: