1 ;; si-wijesekera.mim -- Sinhala input method with wijesekera method
2 ;; Copyright (C) 2005, 2006, 2008, 2009, 2011
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 (",") ("<") (".") (">")
87 ((A-a)) ((A-c)) ((A-o)) ((A-v)) ((A-x)) ((A-z)) ((A-\ )) ((A-.)) ((A-,)) ((A-\'))
88 ((G-a)) ((G-c)) ((G-o)) ((G-v)) ((G-x)) ((G-z)) ((G-\ )) ((G-.)) ((G-,)) ((G-\'))
89 ((S-\ )) ((BackSpace)) ((Delete)))
172 ("|" "්") ; touch (ZWJ 0DCA)
173 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
186 ((| (< c 0x0D9A) (> c 0x0DC6))
281 ((& (>= c 0x0D9A) (<= c 0x0DC6))
307 ((& (= c 0x200C) (= @+1 0x0DD9))
311 (| (< @-2 0x0D9A) (> @-2 0x0DC6)))
314 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
364 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
365 0x0DCA 0x200D 0x0DBA))
374 ((| (= c 0x0DD9) (= c 0x0DDB) (= c 0x0DD2) (= c 0x0DD3))
379 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
380 0x0DCA 0x200D 0x0DBB))
389 ((| (= c 0x0DD9) (= c 0x0DDB))
395 ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6))
400 0x0DBB 0x0DCA 0x200D))
407 (delete-preceding-zw)
429 (cond ((& (>= @-1 0x0D9A) (<= @-1 0x0DC6)) 0x200C))
436 ((& (>= c 0x0D9A) (<= c 0x0DC6) (= @-2 0x0DCA) (= @-1 0x200D))
446 ((| (< @-1 0x0D9A) (> @-1 0x0DC6)))
451 ((& (>= @+0 0x0D9A) (<= @+0 0x0DC6))
471 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
475 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
480 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
492 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
494 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
498 ((& (= @-4 0x0DBB) (= @-3 0x0DCA) (= @-2 0x200D))
503 ((& (>= @-4 0x0D9A) (<= @-4 0x0DC6) (= @-3 0x0DCA) (= @-2 0x200D))
522 (| (= @+0 0x0DD9) (= @+0 0x0DDB)))
526 (delete-following-zw)
549 ((& (>= c 0x0D9A) (<= c 0x0DC6))
596 ((A-.) "ඟ") ((0x2E A-z) "ඟ") ; 0D9F
597 ((G-.) "ඟ") ((0x2E G-z) "ඟ") ; 0D9F
604 ((A-c) "ඦ") ((0x63 A-z) "ඦ") ; 0DA6
605 ((G-c) "ඦ") ((0x63 G-z) "ඦ") ; 0DA6
611 ((A-v) "ඬ") ((0x76 A-z) "ඬ") ; 0DAC
612 ((G-v) "ඬ") ((0x76 G-z) "ඬ") ; 0DAC
618 ((A-o) "ඳ") ((0x6F A-z) "ඳ") ; 0DB3
619 ((G-o) "ඳ") ((0x6F G-z) "ඳ") ; 0DB3
639 ("J" "ළු") ; muurdhaja lu (0DC5 0DD4)
641 ((S-\ ) " ") ; NBSP (00A0)
642 ((A-\ ) "") ; ZWNJ (200C)
643 ((G-\ ) "") ; ZWNJ (200C)
659 ((= @-1 0x0D91) (delete @-) "ඒ") ; 0D92
660 ((= @-1 0x0D94) (delete @-) "ඕ") ; 0D95
661 ((= @-1 0x0DD9) (delete @-) "ේ") ; 0DDA
662 ((= @-1 0x0DDC) (delete @-) "ෝ") ; 0DDD
666 ((= @-1 0x0D85) (delete @-) "ආ") ; 0D86
667 ((= @-1 0x0DD9) (delete @-) "ො") ; 0DDC
671 ((= @-1 0x0D85) (delete @-) "ඇ") ; 0D87
675 ((= @-1 0x0D85) (delete @-) "ඈ") ; 0D88
676 ((& (= @-2 0x0DC5) (= @-1 0x0DD4))
677 (delete @-) "ූ") ; 0DD6
686 ((= @-1 0x0D8D) (delete @-) "ඎ") ; 0D8E
687 ;; The following line does not work when no consonant proceeds.
688 ;; ((= @-1 0x0DD8) (delete @-) "ෲ") ; 0DF2
690 ;; This one works with or without a preceeding consonant.
695 ((= @-1 0x0D8B) (delete @-) "ඌ") ; 0D8C
696 ((= @-1 0x0D8F) (delete @-) "ඐ") ; 0D90
697 ((= @-1 0x0D94) (delete @-) "ඖ") ; 0D96
698 ((= @-1 0x0DD9) (delete @-) "ෞ") ; 0DDE
703 ("H" ; yansaya (0DCA 200D 0DBA)
705 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
706 (move @-) "්ය" (move @>))
710 ("`" ; rakaransaya (0DCA 200D 0DBB)
712 ((| (= @-1 0x0DD2) (= @-1 0x0DD3) (= @-1 0x0DD9) (= @-1 0x0DDB))
713 (move @-) "්ර" (move @>))
716 ("~" ; repaya (0DBB 0DCA 200D)
736 ((& (= use-surrounding-text 1) (= @-0 -1))
737 (shift surrounding-text))
751 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
761 ((| (< @-2 0x0D9A) (> @-2 0x0DC6))
776 ((| (= c 0x0DD9) (= c 0x0DDB))
778 ((& (>= @-2 0x0D9A) (<= @-2 0x0DC6))
783 ((& (>= c 0x0D9A) (<= c 0x0DC6))
786 (shift surrounding-text))
790 (shift surrounding-text)))
794 (shift independent-state))
796 (shift kombuva-state))
805 ((| (= @-1 0x0DD9) (= @-1 0x0DDB))
807 ((| (< @-1 0x0D9A) (> @-1 0x0DC6))
810 (shift join-state))))
821 ((| (= c 0x0DD9) (= c 0x0DDB))
829 (shift independent-state))
838 ((& (= @0 0x0DD9) (= @1 0x0D91))
841 (shift independent-state))
842 ((& (= @0 0x0DD9) (< @2 0))
847 (shift independent-state))
848 ((& (= @0 0x0DDB) (< @2 0))
853 (shift independent-state))
861 ((& (= @0 0x0DD9) (< @2 0))