From: handa Date: Thu, 18 Feb 2010 01:07:22 +0000 (+0000) Subject: (state:init): If surrounding text is not X-Git-Tag: REL-1-6-0~48 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=313159037c7a022859a7691f764c629c0407ba63;p=m17n%2Fm17n-db.git (state:init): If surrounding text is not supported, shift to after-c when an initial consonant is typed. (state:after-c): New state. --- diff --git a/MIM/vi-tcvn.mim b/MIM/vi-tcvn.mim index f78d36b..541c146 100644 --- a/MIM/vi-tcvn.mim +++ b/MIM/vi-tcvn.mim @@ -91,12 +91,12 @@ 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)))) ;; 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)) @@ -105,6 +105,12 @@ If the value is 1, Backspace key undoes the previous key (misc) (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 (consonant (shift after-vc)) diff --git a/MIM/vi-telex.mim b/MIM/vi-telex.mim index 320bebd..37e6381 100644 --- a/MIM/vi-telex.mim +++ b/MIM/vi-telex.mim @@ -101,16 +101,16 @@ 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)) @@ -119,6 +119,12 @@ If the value is 1, Backspace key undoes the previous key (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 (ending-1st-consonant (handle-mark) (shift after-vc)) ; toans/toasn->toán diff --git a/MIM/vi-viqr.mim b/MIM/vi-viqr.mim index 3c35471..9a12acc 100644 --- a/MIM/vi-viqr.mim +++ b/MIM/vi-viqr.mim @@ -82,18 +82,24 @@ 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)))) ;; 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))) + ;; 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 (consonant (shift after-vc)) diff --git a/MIM/vi-vni.mim b/MIM/vi-vni.mim index 007b3fc..703b251 100644 --- a/MIM/vi-vni.mim +++ b/MIM/vi-vni.mim @@ -82,12 +82,12 @@ 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)))) ;; 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)) @@ -95,6 +95,12 @@ If the value is 1, Backspace key undoes the previous key (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 (consonant (shift after-vc))