-
+;; si-wijesekera.mim -- Sinhala input method with wijesekera method
+;; Copyright (C) 2005, 2006, 2008, 2009
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
-(input-method si wijesekera)
+(input-method si wijesekera (version "1.6.l"))
(description "Sinhala input method based on SLS 1134 Rev. 2:2004.
<http://www.fonts.lk/doc/sin-kbd-layout4.pdf>
(macro
;; skip following (virama zwj consonant)* sequence
(forward
- (set cc3 @+3)
+ (set cc3 @+2)
(cond
- ((& (= @+1 0x0DCA) (= @+2 0x200D) (>= cc3 0x0D9A) (<= cc3 0x0DC6))
+ ((& (= @+0 0x0DCA) (= @+1 0x200D) (>= cc3 0x0D9A) (<= cc3 0x0DC6))
(delete @+3)
0x0DCA 0x200D
(insert cc3)
(delete-following-zw
(cond
- ((| (= @+1 0x200C) (= @+1 0x200D))
+ ((| (= @+0 0x200C) (= @+0 0x200D))
(delete @+1)
(delete-following-zw))))
0x0DDF)))
("f"
- (set c @+1)
+ (set c @+0)
(cond
((& (>= c 0x0D9A) (<= c 0x0DC6))
(delete @+1)
(insert c)
(forward)
- (set c @+1)
+ (set c @+0)
(cond
((= c 0x0DCA)
(delete @+1)
((= c 0x0DD9)
(delete @+1)
0x0DDB)
- ((& (= c 0x200C) (= @+2 0x0DD9))
+ ((& (= c 0x200C) (= @+1 0x0DD9))
(delete @+2)
0x200C 0x0DDB)
((& (= @-1 0x0DD9)
((= c 0x0DD9)
(cond
((| (< @-1 0x0D9A) (> @-1 0x0DC6)))
- ((= @+1 0x0D91)
+ ((= @+0 0x0D91)
(delete @-1)
(delete @+1)
0x0D93)
- ((& (>= @+1 0x0D9A) (<= @+1 0x0DC6))
- (set c1 @+1)
+ ((& (>= @+0 0x0D9A) (<= @+0 0x0DC6))
+ (set c1 @+0)
(cond
- ((= @+2 0x0DD9)
+ ((= @+1 0x0DD9)
(merge-kombuva)
0x0DDB)
- ((= @+2 0x0DCA)
+ ((= @+1 0x0DCA)
(merge-kombuva)
0x0DDA)
- ((= @+2 0x0DCF)
+ ((= @+1 0x0DCF)
(merge-kombuva)
0x0DDC)
- ((= @+2 0x0DDF)
+ ((= @+1 0x0DDF)
(merge-kombuva)
0x0DDE)
(1
(cond
((& (>= @-1 0x0D9A)
(<= @-1 0x0DC6)
- (| (= @+1 0x0DD9) (= @+1 0x0DDB)))
+ (| (= @+0 0x0DD9) (= @+0 0x0DDB)))
0x200C)))
((Delete)
(delete-following-zw)
- (set c @+1)
+ (set c @+0)
(cond
((< c 0)
(unhandle)))
((& (>= c 0x0D9A) (<= c 0x0DC6))
(forward)
(cond
- ((= @+1 0x0DD9)
+ ((= @+0 0x0DD9)
(delete @+1)
(move @<)
(insert c))
- ((= @+1 0x0DDB)
+ ((= @+0 0x0DDB)
(delete @+1)
0x0DD9
(move @<)
(insert c))
- ((= @+1 0x0DDA)
+ ((= @+0 0x0DDA)
(delete @+1)
0x0DCA
(move @<)
(insert c))
- ((= @+1 0x0DDC)
+ ((= @+0 0x0DDC)
(delete @+1)
0x0DCF
(move @<)
(insert c))
- ((= @+1 0x0DDE)
+ ((= @+0 0x0DDE)
(delete @+1)
0x0DDF
(move @<)
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
-(input-method ta lk-renganathan)
+(input-method ta lk-renganathan (version "1.6.0"))
(description "Tamil input method with Renganathan layout.
For the detail, see the page: <http://www.locallanguages.lk/>
((= @-1 0x200C)
(delete @-1)))
(cond
- ((= @+1 0x200C)
+ ((= @+0 0x200C)
(delete @+1))))
(post-proc
(cond
((& (>= @-1 0x0B95) (<= @-1 0x0BB9) ; a consonant
- (>= @+1 0x0BC6) (<= @+1 0x0BCC)) ; a left/two-part vowel sign
+ (>= @+0 0x0BC6) (<= @+0 0x0BCC)) ; a left/two-part vowel sign
;; prevent syllable formation
0x200C)
((& (| (< @-2 0x0B95) (> @-2 0x0BB9)) ; not a consonant
(>= @-1 0x0BC6) (<= @-1 0x0BCC) ; a left/two-part vowel sign
- (>= @+1 0x0B95) (<= @+1 0x0BB9) ; a consonant
- (| (< @+2 0x0BBE) (> @+2 0x0BD7))) ; not a vowel sign
- ;; exchange @-1 and @+1
+ (>= @+0 0x0B95) (<= @+0 0x0BB9) ; a consonant
+ (| (< @+1 0x0BBE) (> @+1 0x0BD7))) ; not a vowel sign
+ ;; exchange @-1 and @+0
(set vs @-1)
- (set c @+1)
+ (set c @+0)
(delete @-1)
(delete @+1)
(insert c)
((& (= @-1 0x200C)
(| (< @-2 0x0B95) (> @-2 0x0BB9) ; not a constant
- (< @+1 0x0BC6) (> @+1 0x0BCC))) ; not a left/two-part vowel sign
+ (< @+0 0x0BC6) (> @+0 0x0BCC))) ; not a left/two-part vowel sign
;; delete unnecessary ZWNJ
(delete @-1))
- ((& (= @+1 0x200C)
+ ((& (= @+0 0x200C)
(| (< @-1 0x0B95) (> @-1 0x0BB9) ; not a constant
- (< @+2 0x0BC6) (> @+2 0x0BCC))) ; not a left/two-part vowel sign
+ (< @+1 0x0BC6) (> @+1 0x0BCC))) ; not a left/two-part vowel sign
;; delete unnecessary ZWNJ
(delete @+1))))
(move @>)
(cond
- ((& (= @+1 0x200C)
- (| (< @+2 0x0BC6) (> @+2 0x0BCC))) ; not a left vowel sign
+ ((& (= @+0 0x200C)
+ (| (< @+1 0x0BC6) (> @+1 0x0BCC))) ; not a left vowel sign
(delete @+1)))
(cond
((= vs 0x0BC6)
(cond
- ((= @+1 0x0BBE)
+ ((= @+0 0x0BBE)
(delete @+1)
0x0BCA)
- ((| (= @+1 0x0BB3) (= @+1 0x0BD7))
+ ((| (= @+0 0x0BB3) (= @+0 0x0BD7))
(delete @+1)
0x0BCC)
(1
0x0BC6)))
((= vs 0x0BC7)
(cond
- ((= @+1 0x0BBE)
+ ((= @+0 0x0BBE)
(delete @+1)
0x0BCB)
(1
(cond
((& (>= @-1 0x0B95) (<= @-1 0x0BB9) ; a consonant
- (>= @+1 0x0BC6) (<= @+1 0x0BCC)) ; a left vowel sign
+ (>= @+0 0x0BC6) (<= @+0 0x0BCC)) ; a left vowel sign
0x200C)))
(check-surrounding-text
(cond
- ((& (= @+1 0x0B95) (= @+2 0x0BCD) (= @+3 0x0BB7)) ; k.ssa follows
+ ((& (= @+0 0x0B95) (= @+1 0x0BCD) (= @+2 0x0BB7)) ; k.ssa follows
0x0B95 0x0BCD 0x0BB7
(delete @+3))
- ((& (>= @+1 0x0B95) (<= @+1 0x0BB9)) ; a consonant follows
- (set c @+1)
+ ((& (>= @+0 0x0B95) (<= @+0 0x0BB9)) ; a consonant follows
+ (set c @+0)
(insert c)
(delete @+1))
((& (>= @-1 0x0B95) (<= @-1 0x0BB9)) ; a consonant precedes
(delete @-1)
0x0BCC
(cond
- ((= @+1 0x200C)
+ ((= @+0 0x200C)
(delete @+1))))
((= @-1 0x0B92)
(delete @-1)
0x0B94
(cond
- ((= @+1 0x200C)
+ ((= @+0 0x200C)
(delete @+1))))
(1
0x0BB3
(sign
(cond
- ((= @+1 0x200C)
+ ((= @+0 0x200C)
(delete @+1)))
(move @<)
(cond
(cond
;; additional check-surrounding-text for this vowel sign
- ((& (>= @+1 0x0B95) (<= @+1 0x0BB9) ; a consonant
- (= @+2 0x0BB3))
- (set c @+1)
+ ((& (>= @+0 0x0B95) (<= @+0 0x0BB9) ; a consonant
+ (= @+1 0x0BB3))
+ (set c @+0)
(delete @+2)
(insert c)
0x0BCC)
(1
(check-surrounding-text)
(cond
- ((= @+1 0x0BBE)
+ ((= @+0 0x0BBE)
(delete @+1)
0x0BCA)
- ((= @+1 0x0BD7)
+ ((= @+0 0x0BD7)
(delete @+1)
0x0BCC)
(1
(check-surrounding-text)
(cond
- ((= @+1 0x0BBE)
+ ((= @+0 0x0BBE)
(delete @+1)
0x0BCB)
(1
(delete @-1)))
(cond
- ((& (>= @+1 0x0B95) (<= @+1 0x0BB9) ; a consonant follows
- (| (< @+2 0x0BBE) (> @+2 0x0BD7))) ; not a vowel sign
+ ((& (>= @+0 0x0B95) (<= @+0 0x0BB9) ; a consonant follows
+ (| (< @+1 0x0BBE) (> @+1 0x0BD7))) ; not a vowel sign
;; visual : E C1 | C2 -> E C2 |
;; logical : C1 E | C2 -> C2 E |
(cond
- ((& (= @+1 0x0B95) (= @+2 0x0BCD) (= @+3 0x0BB7)) ; k.ssa
+ ((& (= @+0 0x0B95) (= @+1 0x0BCD) (= @+2 0x0BB7)) ; k.ssa
(delete @+3)
0x0B95 0x0BCD 0x0BB7)
(1
- (set c @+1)
+ (set c @+0)
(delete @+1)
(insert c)))
(insert vs))
(pre-proc)
(cond
- ((& (= @+1 0x0BB6) (= @+2 0x0BCD) (= @+3 0x0BB0) (= @+4 0x0C0)) ; shrii
+ ((& (= @+0 0x0BB6) (= @+1 0x0BCD) (= @+2 0x0BB0) (= @+3 0x0C0)) ; shrii
(delete @+4))
- ((& (= @+1 0x0B95) (= @+2 0x0BCD) (= @+3 0x0BB7)) ; k.ssa
+ ((& (= @+0 0x0B95) (= @+1 0x0BCD) (= @+2 0x0BB7)) ; k.ssa
(cond
- ((& (>= @+4 0x0BC6) (<= @+4 0x0BC8)) ; a left vowel sign
+ ((& (>= @+3 0x0BC6) (<= @+3 0x0BC8)) ; a left vowel sign
(delete @+4)
0x0B95 0x0BCD 0x0BB7)
- ((| (= @+4 0x0BCA) (= @+4 0x0BCB)) ; vowel sign e/ee
+ ((| (= @+3 0x0BCA) (= @+3 0x0BCB)) ; vowel sign e/ee
(delete @+4)
0x0B95 0x0BCD 0x0BB7 0x0BBE)
- ((| (& (>= @+4 0x0BBE) (<= @+4 0x0BC2)) ; vowel sign aa .. uu
- (= @+4 0x0BCC) ; vowel sign ai
- (= @+4 0x0BCD)) ; virama
+ ((| (& (>= @+3 0x0BBE) (<= @+3 0x0BC2)) ; vowel sign aa .. uu
+ (= @+3 0x0BCC) ; vowel sign ai
+ (= @+3 0x0BCD)) ; virama
(delete @+4))
(1
(delete @+3))))
- ((& (>= @+1 0x0B95) (<= @+1 0x0BB9)) ; a consonant
- (set c @+1)
+ ((& (>= @+0 0x0B95) (<= @+0 0x0BB9)) ; a consonant
+ (set c @+0)
(cond
- ((& (>= @+2 0x0BC6) (<= @+2 0x0BC8)) ; a left vowel sign
+ ((& (>= @+1 0x0BC6) (<= @+1 0x0BC8)) ; a left vowel sign
(delete @+2)
(insert c))
- ((| (= @+2 0x0BCA) (= @+2 0x0BCB)) ; vowel sign e/ee
+ ((| (= @+1 0x0BCA) (= @+1 0x0BCB)) ; vowel sign e/ee
(delete @+2)
(insert c)
0x0BBE)
- ((| (& (>= @+2 0x0BBE) (<= @+2 0x0BC2)) ; vowel sign aa .. uu
- (= @+2 0x0BCC) ; vowel sign ai
- (= @+2 0x0BCD)) ; virama
+ ((| (& (>= @+1 0x0BBE) (<= @+1 0x0BC2)) ; vowel sign aa .. uu
+ (= @+1 0x0BCC) ; vowel sign ai
+ (= @+1 0x0BCD)) ; virama
(delete @+2))
(1
(delete @+1))))
- ((| (= @+1 0x0BCA) (= @+1 0x0BCB)) ; vowel sign e/ee
+ ((| (= @+0 0x0BCA) (= @+0 0x0BCB)) ; vowel sign e/ee
(delete @+1)
0x0BBE)
- ((= @+1 0x0BCC) ; vowel sign ai
+ ((= @+0 0x0BCC) ; vowel sign ai
(delete @+1)
0x0BB3)
(delete @-1)))
(move @>)
(cond
- ((= @+1 0x200C)
+ ((= @+0 0x200C)
(delete @+1)))
(commit)))