1 ;; si-wijesekera.mim -- Sinhala input method with wijesekera method
2 ;; Copyright (C) 2005, 2006, 2008, 2009
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
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.
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.
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.
24 (input-method si wijesekera (version "1.6.0"))
26 (description "Sinhala input method based on SLS 1134 Rev. 2:2004.
27 <http://www.siyabas.lk/docs/sin-kbd-layout5.pdf>
28 Although this code supports both surrounding text and preedit,
29 the former is disabled by default to avoid confusion caused by
36 (use-surrounding-text (_"Surrounding text vs. preedit.
37 If 1, try to use surrounding text. Otherwise, use preedit.")
41 ;; skip following (virama zwj consonant)* sequence
45 ((& (= @+0 0x0DCA) (= @+1 0x200D) (>= cc3 0x0D9A) (<= cc3 0x0DC6))
54 ((& (= @-3 0x0DCA) (= @-2 0x200D) (>= cc1 0x0D9A) (<= cc1 0x0DC6))
64 ((| (= @-1 0x200C) (= @-1 0x200D))
66 (delete-preceding-zw))))
70 ((| (= @+0 0x200C) (= @+0 0x200D))
72 (delete-following-zw))))
81 ("A") ("B") ("C") ("D") ("E") ("F") ("G") ("H") ("I") ("J") ("K") ("L") ("M")
82 ("N") ("O") ("P") ("Q") ("R") ("S") ("T") ("U") ("V") ("W") ("X") ("Y") ("Z")
83 ("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h") ("i") ("j") ("k") ("l") ("m")
84 ("n") ("o") ("p") ("q") ("r") ("s") ("t") ("u") ("v") ("w") ("x") ("y") ("z")
85 ("`") ("~") ("\[") ("{") ("\]") ("}") ("\\") ("|") (";") (":") ("'") ("\"")
86 (",") ("<") (".") (">") ((A-o)) ((A-.)) ((A-v)) ((A-c)) ((A-x))
87 ((S-\ )) ((A-\ )) ((A-,)) ((A-a)) ((A-\')) ((A-z)) ((BackSpace)) ((Delete)))
162 ("|" "්") ; touch (ZWJ 0DCA)
163 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
175 ((| (< c 0x0D9A) (> c 0x0DC6))
270 ((& (>= c 0x0D9A) (<= c 0x0DC6))
296 ((& (= c 0x200C) (= @+1 0x0DD9))
300 (| (< @-2 0x0D9A) (> @-2 0x0DC6)))
303 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
336 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
337 0x0DCA 0x200D 0x0DBA))
346 ((| (= c 0x0DD9) (= c 0x0DDB) (= c 0x0DD2) (= c 0x0DD3))
351 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
352 0x0DCA 0x200D 0x0DBB))
361 ((| (= c 0x0DD9) (= c 0x0DDB))
367 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
372 0x0DBB 0x0DCA 0x200D))
379 (delete-preceding-zw)
401 (cond ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6)) 0x200C))
408 ((& (>= c 0x0D9A) (<= c 0x0DC6) (= @-2 0x0DCA) (= @-1 0x200D))
418 ((| (< @-1 0x0D9A) (> @-1 0x0DC6)))
423 ((& (>= @+0 0x0D9A) (<= @+0 0x0DC6))
443 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
447 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
452 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
464 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
466 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
470 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
475 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
494 (| (= @+0 0x0DD9) (= @+0 0x0DDB)))
498 (delete-following-zw)
521 ((& (>= c 0x0D9A) (<= c 0x0DC6))
567 ((A-.) "ඟ") ((0x2E A-z) "ඟ") ; 0D9F
574 ((A-c) "ඦ") ((0x63 A-z) "ඦ") ; 0DA6
580 ((A-v) "ඬ") ((0x76 A-z) "ඬ") ; 0DAC
586 ((A-o) "ඳ") ((0x6F A-z) "ඳ") ; 0DB3
605 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
607 ((S-\ ) " ") ; NBSP (00A0)
608 ((A-\ ) "") ; ZWNJ (200C)
623 ((= @-1 0x0D91) (delete @-) "ඒ") ; 0D92
624 ((= @-1 0x0D94) (delete @-) "ඕ") ; 0D95
625 ((= @-1 0x0DD9) (delete @-) "ේ") ; 0DDA
626 ((= @-1 0x0DDC) (delete @-) "ෝ") ; 0DDD
630 ((= @-1 0x0D85) (delete @-) "ආ") ; 0D86
631 ((= @-1 0x0DD9) (delete @-) "ො") ; 0DDC
635 ((= @-1 0x0D85) (delete @-) "ඇ") ; 0D87
639 ((= @-1 0x0D85) (delete @-) "ඈ") ; 0D88
640 ((& (= @-2 0x0DC5) (= @-1 0x0DD4))
641 (delete @-) "ූ") ; 0DD6
650 ((= @-1 0x0D8D) (delete @-) "ඎ") ; 0D8E
651 ;; The following line does not work when no consonant proceeds.
652 ;; ((= @-1 0x0DD8) (delete @-) "ෲ") ; 0DF2
654 ;; This one works with or without a preceeding consonant.
659 ((= @-1 0x0D8B) (delete @-) "ඌ") ; 0D8C
660 ((= @-1 0x0D8F) (delete @-) "ඐ") ; 0D90
661 ((= @-1 0x0D94) (delete @-) "ඖ") ; 0D96
662 ((= @-1 0x0DD9) (delete @-) "ෞ") ; 0DDE
666 ("H" ; yansaya (0DCA 200D 0DBA)
668 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
669 (move @-) "්ය" (move @>))
673 ("`" ; rakaransaya (0DCA 200D 0DBB)
675 ((| (= @-1 0x0DD2) (= @-1 0x0DD3) (= @-1 0x0DD9) (= @-1 0x0DDB))
676 (move @-) "්ර" (move @>))
679 ("~" ; repaya (0DBB 0DCA 200D)
699 ((& (= use-surrounding-text 1) (= @-0 -1))
700 (shift surrounding-text))
714 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
724 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
739 ((| (= c 0x0DD9) (= c 0x0DDB))
741 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
746 ((& (>= c 0x0D9A) (<= c 0x0DC6))
749 (shift surrounding-text))
753 (shift surrounding-text)))
757 (shift independent-state))
759 (shift kombuva-state))
768 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
770 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
773 (shift join-state))))
784 ((| (= c 0x0DD9) (= c 0x0DDB))
792 (shift independent-state))
801 ((& (= @0 0x0DD9) (= @1 0x0D91))
804 (shift independent-state))
805 ((& (= @0 0x0DD9) (< @2 0))
810 (shift independent-state))
811 ((& (= @0 0x0DDB) (< @2 0))
816 (shift independent-state))
824 ((& (= @0 0x0DD9) (< @2 0))