/usr/share/m17n/vi-viqr.mim is in m17n-db 1.6.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | ;; vi-viqr.mim -- Input method for Vietnames with VIQR key sequence
;; Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; This file is part of the m17n database; a sub-part of the m17n
;; library.
;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.
;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Lesser General Public License for more details.
;; You should have received a copy of the GNU Lesser General Public
;; License along with the m17n library; if not, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
(input-method vi viqr)
(description (_"Vietnames input method using the VIQR key sequence.
Typing Backslash ('\\') toggles the normal mode and English mode.
The following variables are customizable:
tone-mark-on-last: control tone mark position in equivocal cases
backspace-is-undo: control the action of Backspace key (delete or undo)"))
(title "Ắ(VIQR)")
(variable
(tone-mark-on-last
(_"Flag to control tone mark position in equivocal cases.
If this variable is 0 (the default), put tone mark on the first vowel
in such equivocal cases as \"oa\", \"oe\", \"uy\".
Otherwise, put tone mark on the last vowel.")
0 0 1)
(backspace-is-undo
(_"Flag to control the action of Backspace key (delete or undo).
If this variable is 0 (the default), Backspace key deletes the previous
character (e.g. \"q u a i s BS\" => \"quá\").
If the value is 1, Backspace key undoes the previous key
\(e.g. \"q u a i s BS\" => \"quai\").")
0 0 1))
(include (t nil vi-base) macro)
(include (t nil vi-base) map)
(map
(vowel-ext
("a^" ("âấầẩẫậ")) ("A^" ("ÂẤẦẨẪẬ"))
("a(" ("ăắằẳẵặ")) ("A(" ("ĂẮẰẲẴẶ"))
("e^" ("êếềểễệ")) ("E^" ("ÊẾỀỂỄỆ"))
("o^" ("ôốồổỗộ")) ("O^" ("ÔỐỒỔỖỘ"))
("o+" ("ơớờởỡợ")) ("O+" ("ƠỚỜỞỠỢ"))
("u+" ("ưứừửữự")) ("U+" ("ƯỨỪỬỮỰ")))
(consonant-ext
("dd" ?đ) ("DD" ?Đ) ("Dd" ?Đ))
(tone-mark
("0" (set SELECT 0) ?0)
("'" (set SELECT 1) ?')
("`" (set SELECT 2) ?`)
("?" (set SELECT 3) ??)
("~" (set SELECT 4) ?~)
("." (set SELECT 5) ?.))
(temporary-escape
("a^^" "a^") ("A^^" "A^")
("a((" "a(") ("A((" "A(")
("e^^" "e^") ("E^^" "E^")
("o^^" "o^") ("O^^" "O^")
("o++" "o+") ("O++" "O+")
("u++" "u+") ("U++" "U+")))
(state
(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. 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 NST (= @-0 -2)))
(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))
(consonant-ext (shift after-vc))
(vowel (mark M) (set V-3 V-2) (set V-2 V-1) (set V-1 @-1)
(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))
(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)
(cond ((> TPLACE 2) (set SELECT 0))))
(V-2 (set V-1 V-2) (set V-2 0)
(cond ((> TPLACE 1) (set SELECT 0))))
(1 (shift init)))))
;; The state shifted to when a consonant is typed after a vowel.
(after-vc
(t (set C-AFTER-V 1))
(consonant (add C-AFTER-V 1))
(consonant-ext (add C-AFTER-V 1))
(tone-mark (delete @-) (pushback 1) (shift after-t))
(backspace (delete @-)
(sub C-AFTER-V 1)
(cond ((= C-AFTER-V 0) (shift after-v)))))
;; The state shifted to when a tone-mark is typed.
(after-t
(t (set CURRENT-SELECT -1))
(tone-mark (cond ((= CURRENT-SELECT SELECT) (move T) (select 0) (move @>)
(shift temporary-escape))
(1 (delete @-) (handle-mark) (set CURRENT-SELECT SELECT))))
(nil (cond (C-AFTER-V (shift after-vc))
(1 (shift after-v)))))
(temporary-escape
"en"
(t (commit))
(alnum (commit)))
(escape-in-normal-mode
"EN"
(permanent-escape (insert "\\") (shift init))
;; Any other key force shifting to permanent-escape.
(nil (shift permanent-escape)))
(permanent-escape
"EN"
(t (set ESCAPE 1))
(permanent-escape (shift escape-in-permanent-escape))
;; Unhandle any characters.
(nil (unhandle)))
(escape-in-permanent-escape
"Ắ"
(permanent-escape (insert "\\") (commit) (shift permanent-escape))
;; Any other key force shifting to init
))
;; Local Variables:
;; coding: utf-8
;; mode: lisp
;; End:
|