X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=MIM%2Fvi-telex.mim;h=98307f30f131e6c506052910cbcb3715cfaca626;hb=fb4c89602c2bac4788782a93bf8fbf08e78638a5;hp=657fb79178887385350cf30cffed95a7afa96f1d;hpb=59defa49d30757ecc2aed20c0b6d1ec6b18304a3;p=m17n%2Fm17n-db.git diff --git a/MIM/vi-telex.mim b/MIM/vi-telex.mim index 657fb79..98307f3 100644 --- a/MIM/vi-telex.mim +++ b/MIM/vi-telex.mim @@ -1,5 +1,5 @@ ;; vi-telex.mim -- Input method for Vietnames with TELEX key sequence -;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 +;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H15PRO112 @@ -65,9 +65,10 @@ If the value is 1, Backspace key undoes the previous key ("Ooo" ("OÓÒỎÕỌ") ("oóòỏõọ") (set V-2 V-1) (set V-1 ?O))) (consonant-ext - ("dd" (cond ((= C-AFTER-V 0) "dd") (1 ?đ))) ; Works when - ("DD" (cond ((= C-AFTER-V 0) "DD") (1 ?Đ))) ; it is the first - ("Dd" (cond ((= C-AFTER-V 0) "Dd") (1 ?Đ)))) ; letter (not ađ) + ("dd" ?đ) ("DD" ?Đ) ("Dd" ?Đ)) + ;("dd" (cond ((= C-AFTER-V 0) "dd") (1 ?đ))) ; Works when + ;("DD" (cond ((= C-AFTER-V 0) "DD") (1 ?Đ))) ; it is the first + ;("Dd" (cond ((= C-AFTER-V 0) "Dd") (1 ?Đ)))) ; letter (not ađ) (tone-mark ("z" (set SELECT 0) ?z) ("Z" (set SELECT 0) ?Z) @@ -100,22 +101,29 @@ If the value is 1, Backspace key undoes the previous key (init ;; Initialize variables. C is the initial consonant. V-N is the ;; (N-1)th vowel from the last. C-AFTER-V is a number of consonants - ;; typed after vowel. + ;; typed after vowel. NST is 1 iff surrounding text is not supported. (t (set C @-1) (set V-1 0) (set V-2 0) (set V-3 0) (set C-AFTER-V 0) - (set SELECT 0)) + (set SELECT 0) (set NST (= @-0 -2))) - (consonant (set C @-1)) - (consonant-ext (set C @-1)) + (consonant (set C @-1) (cond (NST (shift after-c)))) + (consonant-ext (set C @-1) (cond (NST (shift after-c)))) (consonant-or-tone-mark - (cond ((| (= @-1 ?f) (= @-1 ?j) (= @-1 ?z) ; Invalid beginning consonants + (cond ((| (= @-1 ?f) (= @-1 ?j) (= @-1 ?z) ; Invalid beginning consonants (= @-1 ?F) (= @-1 ?J) (= @-1 ?Z)) (shift temporary-escape)) - (1 (set C @-1)))) + (1 (set C @-1) (cond (NST (shift after-c)))))) ;; Mark M remembers the preedit position after the last vowel. (vowel (mark M) (set V-2 V-1) (set V-1 @-1) (shift after-v)) (vowel-ext (mark M) (set V-2 V-1) (set V-1 @-1) (shift after-v)) (temporary-escape (shift temporary-escape)) - (permanent-escape (shift escape-in-normal-mode))) + (permanent-escape (shift escape-in-normal-mode)) + (smart-quotes)) + + ;; The state shifted to when an initial consonants is typed and + ;; surrounding text is not supported. + (after-c + (vowel (mark M) (set V-2 V-1) (set V-1 @-1) (shift after-v)) + (vowel-ext (mark M) (set V-2 V-1) (set V-1 @-1) (shift after-v))) ;; The state shifted to when a vowel is typed. (after-v @@ -124,6 +132,7 @@ If the value is 1, Backspace key undoes the previous key (move T) (select 0) (handle-mark) (move M)) (vowel-ext (mark M) (set V-3 V-2) (set V-2 V-1) (set V-1 @-1) (move T) (select 0) (handle-mark) (move M)) + (ending-1st-notviet-consonant (shift temporary-escape)) ;; See ending-1st-notviet-consonant section in the vi-base.mim (consonant-or-tone-mark (delete @-) (pushback 1) (shift after-t)) (backspace (delete @-) (cond (V-3 (set V-1 V-2) (set V-2 V-3) (set V-3 0) @@ -141,6 +150,7 @@ If the value is 1, Backspace key undoes the previous key (cond ((| (= @-2 ?n) (= @-2 ?c) ; 1st ending consonant must be n/c (= @-2 ?N) (= @-2 ?C)) (add C-AFTER-V 1)) (1 (shift temporary-escape)))) + (ending-1st-notviet-consonant (shift temporary-escape)) ;; Expand notviet-consonant section in the vi-base.mim (consonant-or-tone-mark (delete @-) (pushback 1) (shift after-t)) (vowel (shift temporary-escape)) ; There can only be one (vowel-ext (shift temporary-escape)) ; main vowel in a word