2 ;; National Institute of Advanced Industrial Science and Technology (AIST)
3 ;; Registration Number H15PRO112
5 ;; This file is part of the m17n database; a sub-part of the m17n
8 ;; The m17n library is free software; you can redistribute it and/or
9 ;; modify it under the terms of the GNU Lesser General Public License
10 ;; as published by the Free Software Foundation; either version 2.1 of
11 ;; the License, or (at your option) any later version.
13 ;; The m17n library is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;; Lesser General Public License for more details.
18 ;; You should have received a copy of the GNU Lesser General Public
19 ;; License along with the m17n library; if not, write to the Free
20 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
23 (input-method si wijesekera)
25 (description "Sinhala input method based on SLS 1134 Rev. 2:2004.
26 <http://www.fonts.lk/doc/sin-kbd-layout4.pdf>
27 This input method uses surrounding text if possible, or a preedit
34 (use-surrounding-text (_"Surrounding text vs. preedit
35 If 1, try to use surrounding text. Otherwise, use preedit.")
39 ;; skip following (virama zwj consonant)* sequence
43 ((& (= @+1 0x0DCA) (= @+2 0x200D) (>= cc3 0x0D9A) (<= cc3 0x0DC6))
52 ((& (= @-3 0x0DCA) (= @-2 0x200D) (>= cc1 0x0D9A) (<= cc1 0x0DC6))
62 ((| (= @-1 0x200C) (= @-1 0x200D))
64 (delete-preceding-zw))))
68 ((| (= @+1 0x200C) (= @+1 0x200D))
70 (delete-following-zw))))
79 ("A") ("B") ("C") ("D") ("E") ("F") ("G") ("H") ("I") ("J") ("K") ("L") ("M")
80 ("N") ("O") ("P") ("Q") ("R") ("S") ("T") ("U") ("V") ("W") ("X") ("Y") ("Z")
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 ("`") ("~") ("\[") ("{") ("\]") ("}") ("\\") ("|") (";") (":") ("'") ("\"")
84 (",") ("<") (".") (">") ((A-o)) ((A-.)) ((A-v)) ((A-c)) ((A-x))
85 ((S-\ )) ((A-\ )) ((A-,)) ((A-a)) ((A-\')) ((A-z)) ((BackSpace)) ((Delete)))
160 ("|" "්") ; touch (ZWJ 0DCA)
161 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
173 ((| (< c 0x0D9A) (> c 0x0DC6))
268 ((& (>= c 0x0D9A) (<= c 0x0DC6))
294 ((& (= c 0x200C) (= @+2 0x0DD9))
298 (| (< @-2 0x0D9A) (> @-2 0x0DC6)))
301 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
334 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
335 0x0DCA 0x200D 0x0DBA))
344 ((| (= c 0x0DD9) (= c 0x0DDB) (= c 0x0DD2) (= c 0x0DD3))
349 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
350 0x0DCA 0x200D 0x0DBB))
359 ((| (= c 0x0DD9) (= c 0x0DDB))
365 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
370 0x0DBB 0x0DCA 0x200D))
377 (delete-preceding-zw)
399 (cond ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6)) 0x200C))
406 ((& (>= c 0x0D9A) (<= c 0x0DC6) (= @-2 0x0DCA) (= @-1 0x200D))
416 ((| (< @-1 0x0D9A) (> @-1 0x0DC6)))
421 ((& (>= @+1 0x0D9A) (<= @+1 0x0DC6))
441 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
445 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
450 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
462 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
464 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
468 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
473 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
492 (| (= @+1 0x0DD9) (= @+1 0x0DDB)))
496 (delete-following-zw)
519 ((& (>= c 0x0D9A) (<= c 0x0DC6))
565 ((A-.) "ඟ") ((0x2E A-z) "ඟ") ; 0D9F
572 ((A-c) "ඦ") ((0x63 A-z) "ඦ") ; 0DA6
578 ((A-v) "ඬ") ((0x76 A-z) "ඬ") ; 0DAC
584 ((A-o) "ඳ") ((0x6F A-z) "ඳ") ; 0DB3
603 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
605 ((S-\ ) " ") ; NBSP (00A0)
606 ((A-\ ) "") ; ZWNJ (200C)
621 ((= @-1 0x0D91) (delete @-) "ඒ") ; 0D92
622 ((= @-1 0x0D94) (delete @-) "ඕ") ; 0D95
623 ((= @-1 0x0DD9) (delete @-) "ේ") ; 0DDA
624 ((= @-1 0x0DDC) (delete @-) "ෝ") ; 0DDD
628 ((= @-1 0x0D85) (delete @-) "ආ") ; 0D86
629 ((= @-1 0x0DD9) (delete @-) "ො") ; 0DDC
633 ((= @-1 0x0D85) (delete @-) "ඇ") ; 0D87
637 ((= @-1 0x0D85) (delete @-) "ඈ") ; 0D88
638 ((& (= @-2 0x0DC5) (= @-1 0x0DD4))
639 (delete @-) "ූ") ; 0DD6
648 ((= @-1 0x0D8D) (delete @-) "ඎ") ; 0D8E
649 ;; The following line does not work when no consonant proceeds.
650 ;; ((= @-1 0x0DD8) (delete @-) "ෲ") ; 0DF2
652 ;; This one works with or without a preceeding consonant.
657 ((= @-1 0x0D8B) (delete @-) "ඌ") ; 0D8C
658 ((= @-1 0x0D8F) (delete @-) "ඐ") ; 0D90
659 ((= @-1 0x0D94) (delete @-) "ඖ") ; 0D96
660 ((= @-1 0x0DD9) (delete @-) "ෞ") ; 0DDE
664 ("H" ; yansaya (0DCA 200D 0DBA)
666 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
667 (move @-) "්ය" (move @>))
671 ("`" ; rakaransaya (0DCA 200D 0DBB)
673 ((| (= @-1 0x0DD2) (= @-1 0x0DD3) (= @-1 0x0DD9) (= @-1 0x0DDB))
674 (move @-) "්ර" (move @>))
677 ("~" ; repaya (0DBB 0DCA 200D)
697 ((& (= use-surrounding-text 1) (= @-0 -1))
698 (shift surrounding-text))
712 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
722 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
737 ((| (= c 0x0DD9) (= c 0x0DDB))
739 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
744 ((& (>= c 0x0D9A) (<= c 0x0DC6))
747 (shift surrounding-text))
751 (shift surrounding-text)))
755 (shift independent-state))
757 (shift kombuva-state))
764 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
766 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
769 (shift join-state))))
780 ((| (= c 0x0DD9) (= c 0x0DDB))
788 (shift independent-state))
797 ((& (= @0 0x0DD9) (= @1 0x0D91))
800 (shift independent-state))
801 ((& (= @0 0x0DD9) (< @2 0))
806 (shift independent-state))
807 ((& (= @0 0x0DDB) (< @2 0))
812 (shift independent-state))
820 ((& (= @0 0x0DD9) (< @2 0))