(require 'quail)
(require 'lao-util)
-(eval-and-compile
-
-(defconst lao-keyboard-mapping
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 "1" "=" "3" "4" "\e(1l\e(B" "5" "\e(1'\e(B" ; SPC .. '
- "7" "8" "6" "\e(1mh\e(B" "\e(1A\e(B" "\e(1*\e(B" "\e(1c\e(B" "\e(1=\e(B" ; ( .. /
- "\e(1"\e(B" "\e(1B\e(B" "\e(1?\e(B" "\e(1b\e(B" "\e(16\e(B" "\e(1X\e(B" "\e(1Y\e(B" "\e(1$\e(B" ; 0 .. 7
- "\e(15\e(B" "\e(1(\e(B" "%" "\e(1G\e(B" "\e(1}\e(B" "\e(1m\e(B" "$" "\)" ; 8 .. ?
- "2" "\e(1Qi\e(B" "\e(1Vi\e(B" "\e(1O\e(B" "." "\e(1Si\e(B" "," ":" ; @ .. G
- "\e(1j\e(B" "\e(1N\e(B" "\e(1k\e(B" "!" "?" "\e(1f\e(B" "\e(1Wi\e(B" "\e(1|\e(B" ; H .. O
- "\e(1]\e(B" "\e(1[i\e(B" "_" ";" "+" "\e(1Ui\e(B" "x" "0" ; P .. W
- "\(" "\e(1Ti\e(B" "\"" "\e(1:\e(B" 0 "\e(1E\e(B" "\e(1\\e(B" "9" ; X .. _
- "\e(1'\e(B" "\e(1Q\e(B" "\e(1V\e(B" "\e(1a\e(B" "\e(1!\e(B" "\e(1S\e(B" "\e(14\e(B" "\e(1`\e(B" ; ` .. g
- "\e(1i\e(B" "\e(1C\e(B" "\e(1h\e(B" "\e(1R\e(B" "\e(1J\e(B" "\e(17\e(B" "\e(1W\e(B" "\e(19\e(B" ; h .. o
- "\e(1-\e(B" "\e(1[\e(B" "\e(1>\e(B" "\e(1K\e(B" "\e(1P\e(B" "\e(1U\e(B" "\e(1M\e(B" "\e(1d\e(B" ; p .. w
- "\e(1;\e(B" "\e(1T\e(B" "\e(1<\e(B" "-" "\e(1K\\e(B" "/" "~" 0] ; x .. DEL
- "A table which maps ASCII key codes to corresponding Lao characters."
- )
-
-)
-
-;; Template of a cdr part of a Quail map when a consonant is entered.
-(defvar lao-consonant-alist nil)
-;; Template of a cdr part of a Quail map when a vowel upper is entered.
-(defvar lao-vowel-upper-alist nil)
-;; Template of a cdr part of a Quail map when a vowel lower is entered.
-(defvar lao-vowel-lower-alist nil)
-;; Template of a cdr part of a Quail map when a semivowel lower is entered.
-(defvar lao-semivowel-lower-alist nil)
-
-;; Return a Quail map corresponding to KEY of length LEN.
-;; The car part of the map is a translation generated automatically.
-;; The cdr part of the map is a copy of ALIST.
-(defun lao-generate-quail-map (key len alist)
- (let ((str "")
- (idx 0))
- (while (< idx len)
- (setq str (concat str (aref lao-keyboard-mapping (aref key idx)))
- idx (1+ idx)))
- (cons (string-to-char (compose-string str)) (copy-alist alist))))
-
-;; Return a Quail map corresponding to KEY of length LEN when Lao
-;; tone mark is entered.
-(defun lao-tone-input (key len)
- (lao-generate-quail-map key len nil))
-
-;; Return a Quail map corresponding to KEY of length LEN when Lao
-;; vowel upper is entered.
-(defun lao-vowel-upper-input (key len)
- (lao-generate-quail-map key len lao-vowel-upper-alist))
-
-;; Return a Quail map corresponding to KEY of length LEN when Lao
-;; vowel lower is entered.
-(defun lao-vowel-lower-input (key len)
- (lao-generate-quail-map key len lao-vowel-lower-alist))
-
-;; Return a Quail map corresponding to KEY of length LEN when Lao
-;; semivowel lower is entered.
-(defun lao-semivowel-lower-input (key len)
- (lao-generate-quail-map key len lao-semivowel-lower-alist))
-
-;; Return an alist which can be a cdr part of a Quail map
-;; corresponding to the current key when Lao consonant is entered.
-(defun lao-consonant-input (key len)
- (copy-alist lao-consonant-alist))
+(defun quail-lao-update-translation (control-flag)
+ (if (integerp control-flag)
+ ;; Non-composable character typed.
+ (setq quail-current-str
+ (buffer-substring (overlay-start quail-overlay)
+ (overlay-end quail-overlay))
+ unread-command-events
+ (string-to-list
+ (substring quail-current-key control-flag)))
+ (setq quail-current-str
+ (compose-string (quail-lookup-map-and-concat quail-current-key))))
+ control-flag)
+
+(defconst lao-key-alist
+ '(("!" . "1")
+ ("\"" . "=")
+ ("#" . "3")
+ ("$" . "4")
+ ("&" . "5")
+ ("%" . "\e(1l\e(B")
+ ("'" . "\e(1'\e(B")
+ ("(" . "7")
+ (")" . "8")
+ ("*" . "6")
+ ("+" . ["\e(1mh\e(B"])
+ ("," . "\e(1A\e(B")
+ ("-" . "\e(1*\e(B")
+ ("." . "\e(1c\e(B")
+ ("/" . "\e(1=\e(B")
+ ("0" . "\e(1"\e(B")
+ ("1" . "\e(1B\e(B")
+ ("2" . "\e(1?\e(B")
+ ("3" . "\e(1b\e(B")
+ ("4" . "\e(16\e(B")
+ ("5" . "\e(1X\e(B")
+ ("6" . "\e(1Y\e(B")
+ ("7" . "\e(1$\e(B")
+ ("8" . "\e(15\e(B")
+ ("9" . "\e(1(\e(B")
+ (":" . "%")
+ (";" . "\e(1G\e(B")
+ ("<" . "\e(1}\e(B")
+ ("=" . "\e(1m\e(B")
+ (">" . "$")
+ ("?" . ")")
+ ("@" . "2")
+ ("A" . ["\e(1Qi\e(B"])
+ ("B" . ["\e(1Vi\e(B"])
+ ("C" . "\e(1O\e(B")
+ ("D" . ".")
+ ("E" . ["\e(1Si\e(B"])
+ ("F" . ",")
+ ("G" . ":")
+ ("H" . "\e(1j\e(B")
+ ("I" . "\e(1N\e(B")
+ ("J" . "\e(1k\e(B")
+ ("K" . "!")
+ ("L" . "?")
+ ("M" . "\e(1f\e(B")
+ ("N" . ["\e(1Wi\e(B"])
+ ("O" . "\e(1|\e(B")
+ ("P" . "\e(1]\e(B")
+ ("Q" . ["\e(1[i\e(B"])
+ ("R" . "_")
+ ("S" . ";")
+ ("T" . "+")
+ ("U" . ["\e(1Ui\e(B"])
+ ("V" . "x")
+ ("W" . "0")
+ ("X" . "(")
+ ("Y" . ["\e(1Ti\e(B"])
+ ("Z" . "\"")
+ ("[" . "\e(1:\e(B")
+ ("]" . "\e(1E\e(B")
+ ("^" . "\e(1\\e(B")
+ ("_" . "9")
+ ("`" . "\e(1'\e(B")
+ ("a" . "\e(1Q\e(B")
+ ("b" . "\e(1V\e(B")
+ ("c" . "\e(1a\e(B")
+ ("d" . "\e(1!\e(B")
+ ("e" . "\e(1S\e(B")
+ ("f" . "\e(14\e(B")
+ ("g" . "\e(1`\e(B")
+ ("h" . "\e(1i\e(B")
+ ("i" . "\e(1C\e(B")
+ ("j" . "\e(1h\e(B")
+ ("k" . "\e(1R\e(B")
+ ("l" . "\e(1J\e(B")
+ ("m" . "\e(17\e(B")
+ ("n" . "\e(1W\e(B")
+ ("o" . "\e(19\e(B")
+ ("p" . "\e(1-\e(B")
+ ("q" . "\e(1[\e(B")
+ ("r" . "\e(1>\e(B")
+ ("s" . "\e(1K\e(B")
+ ("t" . "\e(1P\e(B")
+ ("u" . "\e(1U\e(B")
+ ("v" . "\e(1M\e(B")
+ ("w" . "\e(1d\e(B")
+ ("x" . "\e(1;\e(B")
+ ("y" . "\e(1T\e(B")
+ ("z" . "\e(1<\e(B")
+ ("{" . "-")
+ ("|" . ["\e(1K\\e(B"])
+ ("}" . "/")
+ ("~" . "\e(1l\e(B")
+ ("\\0" . "\e(1p\e(B")
+ ("\\1" . "\e(1q\e(B")
+ ("\\2" . "\e(1r\e(B")
+ ("\\3" . "\e(1s\e(B")
+ ("\\4" . "\e(1t\e(B")
+ ("\\5" . "\e(1u\e(B")
+ ("\\6" . "\e(1v\e(B")
+ ("\\7" . "\e(1w\e(B")
+ ("\\8" . "\e(1x\e(B")
+ ("\\9" . "\e(1y\e(B")
+ ))
+
+(defconst lao-consonant-key-alist nil)
+(defconst lao-semivowel-key-alist nil)
+(defconst lao-vowel-key-alist nil)
+(defconst lao-voweltone-key-alist nil)
+(defconst lao-tone-key-alist nil)
+(defconst lao-other-key-alist nil)
+
+(let ((tail lao-key-alist)
+ elt phonetic-type)
+ (while tail
+ (setq elt (car tail) tail (cdr tail))
+ (if (stringp (cdr elt))
+ (setq phonetic-type (get-char-code-property (aref (cdr elt) 0)
+ 'phonetic-type))
+ (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0)
+ 'phonetic-type))
+ (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0))))
+ (cond ((eq phonetic-type 'consonant)
+ (setq lao-consonant-key-alist (cons elt lao-consonant-key-alist)))
+ ((memq phonetic-type '(vowel-upper vowel-lower))
+ (if (stringp (cdr elt))
+ (setq lao-vowel-key-alist (cons elt lao-vowel-key-alist))
+ (setq lao-voweltone-key-alist
+ (cons elt lao-voweltone-key-alist))))
+ ((eq phonetic-type 'tone)
+ (setq lao-tone-key-alist (cons elt lao-tone-key-alist)))
+ ((eq phonetic-type 'semivowel-lower)
+ (setq lao-semivowel-key-alist (cons elt lao-semivowel-key-alist)))
+ (t
+ (setq lao-other-key-alist (cons elt lao-other-key-alist))))))
(quail-define-package
"lao" "Lao" "\e(1E\e(B" t
"Lao input method simulating Lao keyboard layout based on Thai TIS620"
- nil t t t t nil nil nil nil nil t)
-
-(defmacro lao-quail-define-rules (&rest rules)
- (let ((l rules)
- consonant-alist
- vowel-upper-alist
- vowel-lower-alist
- semivowel-lower-alist
- rule trans ch c-set)
- (while l
- (setq rule (car l))
- (setq trans (nth 1 rule))
- (if (consp trans)
- (setq trans (car trans)))
- (setq c-set (char-category-set (string-to-char trans)))
- (cond ((aref c-set ?2) ; vowel upper
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'lao-vowel-upper-input)
- consonant-alist)))
- ((aref c-set ?3) ; vowel lower
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'lao-vowel-lower-input)
- consonant-alist)
- semivowel-lower-alist
- (cons (cons (string-to-char (car rule))
- 'lao-vowel-lower-input)
- semivowel-lower-alist)))
- ((aref c-set ?4) ; tone
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'lao-tone-input)
- consonant-alist)
- vowel-upper-alist
- (cons (cons (string-to-char (car rule))
- 'lao-tone-input)
- vowel-upper-alist)
- vowel-lower-alist
- (cons (cons (string-to-char (car rule))
- 'lao-tone-input)
- vowel-lower-alist)))
- ((aref c-set ?9) ; semivowel lower
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'lao-semivowel-lower-input)
- consonant-alist)
- vowel-upper-alist
- (cons (cons (string-to-char (car rule))
- 'lao-semivowel-lower-input)
- vowel-upper-alist))))
- (setq l (cdr l)))
- (list 'progn
- (cons 'quail-define-rules rules)
- `(setq lao-consonant-alist ',consonant-alist
- lao-vowel-upper-alist ',vowel-upper-alist
- lao-vowel-lower-alist ',vowel-lower-alist
- lao-semivowel-lower-alist ',semivowel-lower-alist))))
-
-(lao-quail-define-rules
- ("!" "1")
- ("\"" "=")
- ("#" "3")
- ("$" "4")
- ("&" "5")
- ("%" "\e(1l\e(B")
- ("'" ("\e(1'\e(B" . lao-consonant-input))
- ("(" "7")
- (")" "8")
- ("*" "6")
- ("+" "\e0\e(1mh\e1\e(B")
- ("," ("\e(1A\e(B" . lao-consonant-input))
- ("-" ("\e(1*\e(B" . lao-consonant-input))
- ("." "\e(1c\e(B")
- ("/" ("\e(1=\e(B" . lao-consonant-input))
- ("0" ("\e(1"\e(B" . lao-consonant-input))
- ("1" ("\e(1B\e(B" . lao-consonant-input))
- ("2" ("\e(1?\e(B" . lao-consonant-input))
- ("3" "\e(1b\e(B")
- ("4" ("\e(16\e(B" . lao-consonant-input))
- ("5" "\e(1X\e(B")
- ("6" "\e(1Y\e(B")
- ("7" ("\e(1$\e(B" . lao-consonant-input))
- ("8" ("\e(15\e(B" . lao-consonant-input))
- ("9" ("\e(1(\e(B" . lao-consonant-input))
- (":" "%")
- (";" ("\e(1G\e(B" . lao-consonant-input))
- ("<" ("\e(1}\e(B" . lao-consonant-input))
- ("=" "\e(1m\e(B")
- (">" "$")
- ("?" ")")
- ("@" "2")
- ("A" "\e0\e(1Qi\e1\e(B")
- ("B" "\e0\e(1Vi\e1\e(B")
- ("C" "\e(1O\e(B")
- ("D" ".")
- ("E" "\e0\e(1Si\e1\e(B")
- ("F" ",")
- ("G" ":")
- ("H" "\e(1j\e(B")
- ("I" ("\e(1N\e(B" . lao-consonant-input))
- ("J" "\e(1k\e(B")
- ("K" "!")
- ("L" "?")
- ("M" "\e(1f\e(B")
- ("N" "\e0\e(1Wi\e1\e(B")
- ("O" ("\e(1|\e(B" . lao-consonant-input))
- ("P" "\e(1]\e(B")
- ("Q" "\e0\e(1[i\e1\e(B")
- ("R" "_")
- ("S" ";")
- ("T" "+")
- ("U" "\e0\e(1Ui\e1\e(B")
- ("V" "x")
- ("W" "0")
- ("X" "(")
- ("Y" "\e0\e(1Ti\e1\e(B")
- ("Z" "\"")
- ("[" ("\e(1:\e(B" . lao-consonant-input))
- ("]" ("\e(1E\e(B" . lao-consonant-input))
- ("^" "\e(1\\e(B")
- ("_" "9")
- ("`" ("\e(1'\e(B" . lao-consonant-input))
- ("a" "\e(1Q\e(B")
- ("b" "\e(1V\e(B")
- ("c" "\e(1a\e(B")
- ("d" ("\e(1!\e(B" . lao-consonant-input))
- ("e" "\e(1S\e(B")
- ("f" ("\e(14\e(B" . lao-consonant-input))
- ("g" "\e(1`\e(B")
- ("h" "\e(1i\e(B")
- ("i" ("\e(1C\e(B" . lao-consonant-input))
- ("j" "\e(1h\e(B")
- ("k" "\e(1R\e(B")
- ("l" ("\e(1J\e(B" . lao-consonant-input))
- ("m" ("\e(17\e(B" . lao-consonant-input))
- ("n" "\e(1W\e(B")
- ("o" ("\e(19\e(B" . lao-consonant-input))
- ("p" ("\e(1-\e(B" . lao-consonant-input))
- ("q" "\e(1[\e(B")
- ("r" ("\e(1>\e(B" . lao-consonant-input))
- ("s" ("\e(1K\e(B" . lao-consonant-input))
- ("t" "\e(1P\e(B")
- ("u" "\e(1U\e(B")
- ("v" ("\e(1M\e(B" . lao-consonant-input))
- ("w" "\e(1d\e(B")
- ("x" ("\e(1;\e(B" . lao-consonant-input))
- ("y" "\e(1T\e(B")
- ("z" ("\e(1<\e(B" . lao-consonant-input))
- ("{" "-")
- ("|" ("\e0\e(1K\\e1\e(B" . lao-consonant-input))
- ("}" "/")
- ("~" "\e(1l\e(B")
- ("\\0" "\e(1p\e(B")
- ("\\1" "\e(1q\e(B")
- ("\\2" "\e(1r\e(B")
- ("\\3" "\e(1s\e(B")
- ("\\4" "\e(1t\e(B")
- ("\\5" "\e(1u\e(B")
- ("\\6" "\e(1v\e(B")
- ("\\7" "\e(1w\e(B")
- ("\\8" "\e(1x\e(B")
- ("\\9" "\e(1y\e(B")
- )
-
+ nil t t t t nil nil nil 'quail-lao-update-translation nil t)
+
+(quail-install-map
+ (quail-map-from-table
+ '((base-state (lao-consonant-key-alist . svt-state)
+ lao-vowel-key-alist
+ lao-voweltone-key-alist
+ lao-tone-key-alist
+ lao-other-key-alist)
+ (svt-state (lao-semivowel-key-alist . v-state)
+ (lao-vowel-key-alist . t-state)
+ lao-voweltone-key-alist)
+ (v-state (lao-vowel-key-alist . t-state))
+ (t-state lao-tone-key-alist))))
;;; quail/lao.el ends here
;; key sequence:
;; consonant [+ semi-vowel-sign-lo ] + vowel [+ maa-sakod ] [+ tone-mark ]
-(eval-and-compile
+(defun quail-lao-update-translation (control-flag)
+ (if (integerp control-flag)
+ ;; Non-composable character typed.
+ (setq quail-current-str
+ (buffer-substring (overlay-start quail-overlay)
+ (overlay-end quail-overlay))
+ unread-command-events
+ (string-to-list
+ (substring quail-current-key control-flag)))
+ (let ((lao-str (lao-transcribe-roman-to-lao-string quail-current-key)))
+ (if (> (aref lao-str 0) 255)
+ (setq quail-current-str lao-str)
+ (or quail-current-str
+ (setq quail-current-str quail-current-key)))))
+ control-flag)
-;; Upper vowels and tone-marks are put on the letter.
-;; Semi-vowel-sign-lo and lower vowels are put under the letter.
-(defconst lrt-single-consonant-table
- `(("k" . ?\e(1!\e(B)
- ("kh" . ?\e(1"\e(B)
- ("qh" . ?\e(1$\e(B)
- ("ng" . ?\e(1'\e(B)
- ("j" . ?\e(1(\e(B)
- ("s" . ?\e(1J\e(B)
- ("x" . ?\e(1*\e(B)
- ("y" . ?\e(1-\e(B)
- ("d" . ?\e(14\e(B)
- ("t" . ?\e(15\e(B)
- ("th" . ?\e(16\e(B)
- ("dh" . ?\e(17\e(B)
- ("n" . ?\e(19\e(B)
- ("b" . ?\e(1:\e(B)
- ("p" . ?\e(1;\e(B)
- ("hp" . ?\e(1<\e(B)
- ("fh" . ?\e(1=\e(B)
- ("ph" . ?\e(1>\e(B)
- ("f" . ?\e(1?\e(B)
- ("m" . ?\e(1A\e(B)
- ("gn" . ?\e(1B\e(B)
- ("l" . ?\e(1E\e(B)
- ("r" . ?\e(1C\e(B)
- ("v" . ?\e(1G\e(B)
- ("w" . ?\e(1G\e(B)
- ("hh" . ?\e(1K\e(B)
- ("O" . ?\e(1M\e(B)
- ("h" . ?\e(1N\e(B)
- ("nh" . ?\e(1|\e(B)
- ("mh" . ?\e(1}\e(B)
- ("lh" . "\e0\e(1K\\e(B\e1")
- ))
-
-;; Semi-vowel-sign-lo is put under the first letter.
-;; Lower vowels are put under the last letter.
-;; Upper vowels and tone-marks are put on the last letter.
-(defconst lrt-double-consonant-table
- '(("ngh" . "\e(1K'\e(B")
- ("yh" . "\e(1K]\e(B")
- ("wh" . "\e(1KG\e(B")
- ("hl" . "\e(1KE\e(B")
- ("hy" . "\e(1K-\e(B")
- ("hn" . "\e(1K9\e(B")
- ("hm" . "\e(1KA\e(B")
- ))
-
-(defconst lrt-semi-vowel-sign-lo
- '("r" . ?\e(1\\e(B))
-
-(defconst lrt-vowel-table
- '(("a" "\e(1P\e(B" (0 ?\e(1P\e(B) (0 ?\e(1Q\e(B))
- ("ar" "\e(1R\e(B" (0 ?\e(1R\e(B))
- ("i" "\e(1T\e(B" (0 ?\e(1T\e(B))
- ("ii" "\e(1U\e(B" (0 ?\e(1U\e(B))
- ("eu" "\e(1V\e(B" (0 ?\e(1V\e(B))
- ("ur" "\e(1W\e(B" (0 ?\e(1W\e(B))
- ("u" "\e(1X\e(B" (0 ?\e(1X\e(B))
- ("uu" "\e(1Y\e(B" (0 ?\e(1Y\e(B))
- ("e" "\e(1`\e(B \e(1P\e(B" (?\e(1`\e(B 0 ?\e(1P\e(B) (?\e(1`\e(B 0 ?\e(1Q\e(B))
- ("ee" "\e(1`\e(B" (?\e(1`\e(B 0))
- ("ae" "\e(1a\e(B \e(1P\e(B" (?\e(1a\e(B 0 ?\e(1P\e(B) (?\e(1a\e(B 0 ?\e(1Q\e(B))
- ("aa" "\e(1a\e(B" (?\e(1a\e(B 0))
- ("o" "\e(1b\e(B \e(1P\e(B" (?\e(1b\e(B 0 ?\e(1P\e(B) (0 ?\e(1[\e(B) (?\e(1-\e(B ?\e(1b\e(B 0 ?\e(1Q\e(B) (?\e(1G\e(B ?\e(1b\e(B 0 ?\e(1Q\e(B))
- ("oo" "\e(1b\e(B" (?\e(1b\e(B 0))
- ("oe" "\e(1`\e(B \e(1RP\e(B" (?\e(1`\e(B 0 ?\e(1R\e(B ?\e(1P\e(B) (0 ?\e(1Q\e(B ?\e(1M\e(B))
- ("or" "\e(1m\e(B" (0 ?\e(1m\e(B) (0 ?\e(1M\e(B))
- ("er" "\e(1`\e(B \e(1T\e(B" (?\e(1`\e(B 0 ?\e(1T\e(B))
- ("ir" "\e(1`\e(B \e(1U\e(B" (?\e(1`\e(B 0 ?\e(1U\e(B))
- ("ua" "\e(1[GP\e(B" (0 ?\e(1[\e(B ?\e(1G\e(B ?\e(1P\e(B) (0 ?\e(1Q\e(B ?\e(1G\e(B))
- ("uaa" "\e(1[G\e(B" (0 ?\e(1[\e(B ?\e(1G\e(B) (0 ?\e(1G\e(B))
- ("ie" "\e(1`Q]P\e(B" (?\e(1`\e(B 0 ?\e(1Q\e(B ?\e(1]\e(B ?\e(1P\e(B) (0 ?\e(1Q\e(B ?\e(1]\e(B))
- ("ia" "\e(1`Q]\e(B" (?\e(1`\e(B 0 ?\e(1Q\e(B ?\e(1]\e(B) (0 ?\e(1]\e(B))
- ("ea" "\e(1`VM\e(B" (?\e(1`\e(B 0 ?\e(1V\e(B ?\e(1M\e(B))
- ("eaa" "\e(1`WM\e(B" (?\e(1`\e(B 0 ?\e(1W\e(B ?\e(1M\e(B))
- ("ai" "\e(1d\e(B" (?\e(1d\e(B 0))
- ("ei" "\e(1c\e(B" (?\e(1c\e(B 0))
- ("ao" "\e(1`[R\e(B" (?\e(1`\e(B 0 ?\e(1[\e(B ?\e(1R\e(B))
- ("aM" "\e(1S\e(B" (0 ?\e(1S\e(B))))
-
-;; Maa-sakod is put at the tail.
-(defconst lrt-maa-sakod-table
- '((?k . ?\e(1!\e(B)
- (?g . ?\e(1'\e(B)
- (?y . ?\e(1-\e(B)
- (?d . ?\e(14\e(B)
- (?n . ?\e(19\e(B)
- (?b . ?\e(1:\e(B)
- (?m . ?\e(1A\e(B)
- (?v . ?\e(1G\e(B)
- (?w . ?\e(1G\e(B)
- ))
-
-(defconst lrt-tone-mark-table
- '(("'" . ?\e(1h\e(B)
- ("\"" . ?\e(1i\e(B)
- ("^" . ?\e(1j\e(B)
- ("+" . ?\e(1k\e(B)
- ("~" . ?\e(1l\e(B)))
-
-;; Return list of composing patterns for normal (without maa-sakod)
-;; key sequence and with-maa-sakod key sequence starting with single
-;; consonant C and optional SEMI-VOWEL.
-(defun lrt-composing-pattern-single-c (c semi-vowel vowel-pattern)
- (let* ((patterns (copy-sequence vowel-pattern))
- (tail patterns)
- place)
- ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
- (while tail
- ;; At first, make a copy.
- (setcar tail (copy-sequence (car tail)))
- ;; Then, do embedding.
- (setq place (memq 0 (car tail)))
- (setcar place c)
- (if semi-vowel
- (setcdr place (cons semi-vowel (cdr place))))
- (setq tail (cdr tail)))
- patterns))
-
-;; Return list of composing patterns for normal (without maa-sakod)
-;; key sequence and with-maa-sakod key sequence starting with double
-;; consonant STR and optional SEMI-VOWEL.
-(defun lrt-composing-pattern-double-c (str semi-vowel vowel-pattern)
- (let* ((patterns (copy-sequence vowel-pattern))
- (tail patterns)
- (chars (string-to-list
- (if (= (length str) 1)
- (decompose-string str)
- str)))
- place)
- ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
- (while tail
- ;; At first, make a copy.
- (setcar tail (copy-sequence (car tail)))
- ;; Then, do embedding.
- (setq place (memq 0 (car tail)))
- (setcar place (car chars))
- (setcdr place (cons (nth 1 chars) (cdr place)))
- (if semi-vowel
- ;; Embed SEMI-VOWEL in between CHARS.
- (setcdr place (cons semi-vowel (cdr place))))
- (setq tail (cdr tail)))
- patterns))
-
-;; Return a string made of characters in CHAR-LIST while composing
-;; such characters as vowel-upper, vowel-lower, semi-vowel(lower),
-;; and tone-mark with the preceding base character.
-(defun lrt-compose-string (char-list)
- ;; Make a copy because the following work alters it.
- (setq char-list (copy-sequence char-list))
- (let ((i -1)
- (l char-list))
- (while l
- (if (memq (get-char-code-property (car l) 'phonetic-type)
- '(vowel-upper vowel-lower semivowel-lower tone))
- (let (composed-char)
- (if (< i 0)
- ;; No preceding base character.
- (error "Invalid CHAR-LIST: %s" char-list))
- (setq composed-char
- (string-to-char (compose-chars (nth i char-list) (car l))))
- (setcar (nthcdr i char-list) composed-char)
- (setq l (cdr l))
- (setcdr (nthcdr i char-list) l))
- (setq l (cdr l))
- (setq i (1+ i))))
- (concat (apply 'vector char-list))))
-
-(defun lrt-compose-c-s-v (consonant semi-vowel vowel-pattern)
- (let ((pattern-list
- (if (integerp consonant)
- (lrt-composing-pattern-single-c
- consonant semi-vowel vowel-pattern)
- (lrt-composing-pattern-double-c
- consonant semi-vowel vowel-pattern))))
- (cons (vector (lrt-compose-string (car pattern-list)))
- (cons t pattern-list))))
-
-)
-
-(defun lrt-handle-maa-sakod ()
- (interactive)
- (if (or (= (length quail-current-key) 0)
- (not quail-current-data))
- (quail-self-insert-command)
- (if (not (car quail-current-data))
- (progn
- (setq quail-current-data nil)
- (setq unread-command-events
- (cons last-command-event unread-command-events))
- (quail-terminate-translation))
- (if (not (integerp last-command-event))
- (error "Bogus calling sequence"))
- (let* ((maa-sakod (cdr (assq last-command-event lrt-maa-sakod-table)))
- (maa-sakod-pattern (append
- (or (cdr (assq maa-sakod
- (nthcdr 3 quail-current-data)))
- (nth 2 quail-current-data)
- (nth 1 quail-current-data))
- (list maa-sakod))))
- (quail-delete-region)
- (setq quail-current-str (lrt-compose-string maa-sakod-pattern))
- (insert quail-current-str)
- (quail-show-translations)
- (setq quail-current-data (list nil maa-sakod-pattern))))))
-
-(defun lrt-handle-tone-mark ()
- (interactive)
- (if (= (length quail-current-key) 0)
- (quail-self-insert-command)
- (if (not quail-current-data)
- (progn
- (setq unread-command-events
- (cons last-command-event unread-command-events))
- (quail-terminate-translation))
- (if (not (integerp last-command-event))
- (error "Bogus calling sequence"))
- (let* ((tone-mark (cdr (assoc (char-to-string last-command-event)
- lrt-tone-mark-table)))
- (tone-mark-pattern
- (if (car quail-current-data)
- (copy-sequence (nth 1 quail-current-data))
- ;; No need of copy because lrt-handle-maa-sakod should
- ;; have already done it.
- (nth 1 quail-current-data)))
- (tail tone-mark-pattern)
- (double-consonant-keys lrt-double-consonant-table)
- (double-consonant-flag nil)
- place)
-
- ;; Set DOUBLE-CONSONANT-FLAG to t if a user entered a double
- ;; consonant.
- (while (and double-consonant-keys (not double-consonant-flag))
- (setq double-consonant-flag
- (eq (string-match (car (car double-consonant-keys))
- quail-current-key)
- 0)
- double-consonant-keys (cdr double-consonant-keys)))
-
- ;; Find a place to embed TONE-MARK. It should be after a
- ;; single or double consonant and following upper or lower vowels.
- (while (and tail (not place))
- (if (and
- (eq (get-char-code-property (car tail) 'phonetic-type)
- 'consonant)
- ;; Skip `\e(1K\e(B' if it is the first letter of double consonant.
- (or (not double-consonant-flag)
- (/= (car tail) ?\e(1K\e(B)))
- (progn
- (setq place tail)
- (setq tail (cdr tail))
- (while (and tail
- (memq (get-char-code-property (car tail)
- 'phonetic-type)
- '(vowel-upper vowel-lower semivowel-lower)))
- (setq place tail tail (cdr tail))))
- (setq tail (cdr tail))))
- ;; Embed TONE-MARK.
- (setcdr place (cons tone-mark (cdr place)))
- (quail-delete-region)
- (insert (lrt-compose-string tone-mark-pattern))
- (setq quail-current-data nil)
- (quail-terminate-translation)))))
-
-(defmacro lrt-generate-quail-map ()
- `(quail-install-map
- ',(let ((map (list nil))
- (semi-vowel-key (car lrt-semi-vowel-sign-lo))
- (semi-vowel-char (cdr lrt-semi-vowel-sign-lo))
- l1 e1 l2 e2 pattern key)
- ;; Single consonants.
- (setq l1 lrt-single-consonant-table)
- (while l1
- (setq e1 (car l1))
- (quail-defrule-internal (car e1) (vector (cdr e1)) map)
- (quail-defrule-internal
- (concat (car e1) semi-vowel-key)
- (if (stringp (cdr e1))
- (compose-string (format "%s%c" (cdr e1) semi-vowel-char))
- (compose-string (format "%c%c" (cdr e1) semi-vowel-char)))
- map)
- (setq l2 lrt-vowel-table)
- (while l2
- (setq e2 (car l2))
- (setq key (concat (car e1) (car e2))
- pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
- (quail-defrule-internal key pattern map)
- (quail-defrule-internal
- (concat key " ")
- (vector (concat (aref (car pattern) 0) " ")) map)
- (setq key (concat (car e1) semi-vowel-key (car e2))
- pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
- (nthcdr 2 e2)))
- (quail-defrule-internal key pattern map)
- (quail-defrule-internal
- (concat key " ")
- (vector (concat (aref (car pattern) 0) " ")) map)
- (setq l2 (cdr l2)))
- (setq l1 (cdr l1)))
-
- ;; Double consonants.
- (setq l1 lrt-double-consonant-table)
- (while l1
- (setq e1 (car l1))
- (quail-defrule-internal (car e1) (vector (cdr e1)) map)
- (quail-defrule-internal
- (concat (car e1) semi-vowel-key)
- (vector (concat (compose-string
- (format "%c%c" (aref (cdr e1) 0) semi-vowel-char))
- (substring (cdr e1) 1)))
- map)
- (setq l2 lrt-vowel-table)
- (while l2
- (setq e2 (car l2))
- (setq key (concat (car e1) (car e2))
- pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
- (quail-defrule-internal key pattern map)
- (quail-defrule-internal
- (concat key " ")
- (vector (concat (aref (car pattern) 0) " ")) map)
- (setq key (concat (car e1) semi-vowel-key (car e2))
- pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
- (nthcdr 2 e2)))
- (quail-defrule-internal key pattern map)
- (quail-defrule-internal
- (concat key " ")
- (vector (concat (aref (car pattern) 0) " ")) map)
- (setq l2 (cdr l2)))
- (setq l1 (cdr l1)))
-
- ;; Vowels.
- (setq l1 lrt-vowel-table)
- (while l1
- (setq e1 (car l1) l1 (cdr l1))
- (quail-defrule-internal (car e1) (vector (nth 1 e1)) map))
-
- ;; Tone-marks.
- (setq l1 lrt-tone-mark-table)
- (while l1
- (setq e1 (car l1) l1 (cdr l1))
- (quail-defrule-internal (car e1) (cdr e1) map))
-
- map)))
(quail-define-package
"lao-lrt" "Lao" "\e(1E\e(BR" t
`\\' (backslash) + `\\' => \e(1f\e(B LAO KO LA (REPETITION)
`\\' (backslash) + `$' => \e(1O\e(B LAO ELLIPSIS
"
- '(("k" . lrt-handle-maa-sakod)
- ("g" . lrt-handle-maa-sakod)
- ("y" . lrt-handle-maa-sakod)
- ("d" . lrt-handle-maa-sakod)
- ("n" . lrt-handle-maa-sakod)
- ("b" . lrt-handle-maa-sakod)
- ("m" . lrt-handle-maa-sakod)
- ("v" . lrt-handle-maa-sakod)
- ("w" . lrt-handle-maa-sakod)
- ("'" . lrt-handle-tone-mark)
- ("\"" . lrt-handle-tone-mark)
- ("^" . lrt-handle-tone-mark)
- ("+" . lrt-handle-tone-mark)
- ("~" . lrt-handle-tone-mark))
- 'forget-last-selection 'deterministic 'kbd-translate 'show-layout
- nil nil nil nil nil t)
-
-(lrt-generate-quail-map)
-
-;; Additional key definitions for Lao digits.
+ nil 'forget-last-selection 'deterministic 'kbd-translate 'show-layout
+ nil nil nil 'quail-lao-update-translation nil t)
-(quail-defrule "\\0" ?\e(1p\e(B)
-(quail-defrule "\\1" ?\e(1q\e(B)
-(quail-defrule "\\2" ?\e(1r\e(B)
-(quail-defrule "\\3" ?\e(1s\e(B)
-(quail-defrule "\\4" ?\e(1t\e(B)
-(quail-defrule "\\5" ?\e(1u\e(B)
-(quail-defrule "\\6" ?\e(1v\e(B)
-(quail-defrule "\\7" ?\e(1w\e(B)
-(quail-defrule "\\8" ?\e(1x\e(B)
-(quail-defrule "\\9" ?\e(1y\e(B)
-(quail-defrule "\\\\" ?\e(1f\e(B)
-(quail-defrule "\\$" ?\e(1O\e(B)
+;; LRT (Lao Roman Transcription) input method accepts the following
+;; key sequence:
+;; consonant [ semi-vowel-sign-lo ] vowel [ maa-sakod ] [ tone-mark ]
+
+(quail-install-map
+ (quail-map-from-table
+ '((base-state (lao-transcription-consonant-alist . sv-state)
+ lao-transcription-vowel-alist
+ lao-transcription-tone-alist)
+ (sv-state (lao-transcription-semi-vowel-alist . v-state)
+ (lao-transcription-vowel-alist . mt-state))
+ (v-state (lao-transcription-vowel-alist . mt-state))
+ (mt-state (lao-transcription-maa-sakod-alist . t-state)
+ lao-transcription-tone-alist)
+ (t-state lao-transcription-tone-alist))))
;;; quail/lrt.el ends here
(require 'quail)
(require 'thai-util)
-(eval-and-compile
+(defun quail-thai-update-translation (control-flag)
+ (if (integerp control-flag)
+ ;; Non-composable character typed.
+ (setq quail-current-str
+ (buffer-substring (overlay-start quail-overlay)
+ (overlay-end quail-overlay))
+ unread-command-events
+ (string-to-list
+ (substring quail-current-key control-flag)))
+ (setq quail-current-str
+ (compose-string (quail-lookup-map-and-concat quail-current-key))))
+ control-flag)
+
+(defun thai-generate-quail-map (translation-table)
+ (let ((i 0)
+ consonant vowel tone voweltone others)
+ ;; Categorize Thai characters into one of above.
+ (while (< i 128)
+ (let ((trans (aref translation-table i))
+ ptype)
+ (if (eq trans 0)
+ nil
+ (if (> (length trans) 1)
+ (setq ptype 'voweltone
+ trans (vector trans))
+ (setq ptype (get-char-code-property (aref trans 0) 'phonetic-type))
+ (cond ((memq ptype '(vowel-upper vowel-lower))
+ (setq ptype 'vowel))
+ ((not (memq ptype '(consonant tone)))
+ (setq ptype 'others))))
+ (set ptype (cons (cons (char-to-string i) trans)
+ (symbol-value ptype)))))
+ (setq i (1+ i)))
+
+ (quail-map-from-table
+ '((base-state (consonant . vt-state)
+ vowel tone voweltone others)
+ (vt-state (vowel . t-state)
+ voweltone tone)
+ (t-state tone)))))
-(defvar thai-keyboard-mapping-alist
- '((kesmanee
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 "#" "\e,TF\e(B" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e0\e,TQi\e1\e(B" "\e,T'\e(B" ; SPC .. '
- "\e,Tv\e(B" "\e,Tw\e(B" "\e,Tu\e(B" "\e,Ty\e(B" "\e,TA\e(B" "\e,T"\e(B" "\e,Tc\e(B" "\e,T=\e(B" ; ( .. /
- "\e,T(\e(B" "\e,TE\e(B" "/" "_" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B" ; 0 .. 7
- "\e,T$\e(B" "\e,T5\e(B" "\e,T+\e(B" "\e,TG\e(B" "\e,T2\e(B" "\e,T*\e(B" "\e,TL\e(B" "\e,TF\e(B" ; 8 .. ?
- "\e,Tq\e(B" "\e,TD\e(B" "\e,TZ\e(B" "\e,T)\e(B" "\e,T/\e(B" "\e,T.\e(B" "\e,Tb\e(B" "\e,T,\e(B" ; @ .. G
- "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "\e,Tn\e(B" "\e,Tl\e(B" "\e,TO\e(B" ; H .. O
- "\e,T-\e(B" "\e,Tp\e(B" "\e,T1\e(B" "\e,T&\e(B" "\e,T8\e(B" "\e,Tj\e(B" "\e,TN\e(B" "\"" ; P .. W
- ")" "\e,Tm\e(B" "(" "\e,T:\e(B" "\e,T_\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B" ; X .. _
- "\e,T#\e(B" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B" ; ` .. g
- "\e,Ti\e(B" "\e,TC\e(B" "\e,Th\e(B" "\e,TR\e(B" "\e,TJ\e(B" "\e,T7\e(B" "\e,TW\e(B" "\e,T9\e(B" ; h .. o
- "\e,TB\e(B" "\e,Tf\e(B" "\e,T>\e(B" "\e,TK\e(B" "\e,TP\e(B" "\e,TU\e(B" "\e,TM\e(B" "\e,Td\e(B" ; p .. w
- "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,To\e(B" "." "\e,T%\e(B" 0] ; x .. DEL
- nil nil)
-
- (pattachote
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. '
- "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. /
- "\e,Tp\e(B" "=" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,Tu\e(B" "\e,TY\e(B" "\e,Tw\e(B" ; 0 .. 7
- "\e,Tx\e(B" "\e,Ty\e(B" "\e,T&\e(B" "\e,Td\e(B" "\e,T?\e(B" "\e,Tv\e(B" "\e,T2\e(B" "\e,TL\e(B" ; 8 .. ?
- "\"" "\e,Tk\e(B" "\e,TQ\e(B" "\e,T0\e(B" "\e,TS\e(B" "\e,Tf\e(B" "\e,T3\e(B" "\e,Tl\e(B" ; @ .. G
- "\e,TW\e(B" "\e,T+\e(B" "\e,T<\e(B" "\e,T*\e(B" "\e,Tb\e(B" "\e,TN\e(B" "\e,TH\e(B" "\e,T6\e(B" ; H .. O
- "\e,T2\e(B" "\e,Tj\e(B" "\e,T-\e(B" "\e,T8\e(B" "\e,TI\e(B" "\e,T=\e(B" "\e,T@\e(B" "\e,TD\e(B" ; P .. W
- "\e,T.\e(B" "\e,TV\e(B" "\e,T.\e(B" "\e,Tc\e(B" "\e,TZ\e(B" "\e,T2\e(B" "\e,TX\e(B" "-" ; X .. _
- "\e,T#\e(B" "\e,Ti\e(B" "\e,TT\e(B" "\e,TE\e(B" "\e,T'\e(B" "\e,TB\e(B" "\e,T!\e(B" "\e,TQ\e(B" ; ` .. g
- "\e,TU\e(B" "\e,TA\e(B" "\e,TR\e(B" "\e,T9\e(B" "\e,T`\e(B" "\e,TJ\e(B" "\e,T$\e(B" "\e,TG\e(B" ; h .. o
- "\e,Ta\e(B" "\e,Tg\e(B" "\e,TM\e(B" "\e,T7\e(B" "\e,TC\e(B" "\e,T4\e(B" "\e,TK\e(B" "\e,T5\e(B" ; p .. w
- "\e,T;\e(B" "\e,Th\e(B" "\e,T:\e(B" "\e,TO\e(B" "\e,Tm\e(B" "\e,TF\e(B" "\e,T%\e(B" 0] ; x .. DEL
- nil nil)
- )
- "Alist of Thai keyboard types vs. corresponding mapping tables.
-Each element is a list of:
- KEYBOARD-TYPE, ASCII-THAI-TABLE, CONSONANT-MAP-TEMPLATE,
- and VOWEL-UPPER-LOWER-TEMPLATE.
-
-KEYBOARD-TYPE is a symbol, one of kesmanee or pattachote.
-
-ASCII-THAI-TABLE is a vector indexed by an ASCII key code
-and the value is the one-char string of Thai character
-assigned at the location of ASCII key on the specific Thai keyboard.
-The value is 0 if no Thai character is assigned at the location.
-
-CONSONANT-MAP-TEMPLATE is a template of a cdr part of a Quail map when
-a consonant is entered.
-
-VOWEL-UPPER-LOWER-TEMPLATE is a template of a cdr part of a Quail map
-when a vowel upper or a vowel lower is entered.")
-
-(defmacro thai-keyboard-info (keyboard-type)
- `(assq ,keyboard-type thai-keyboard-mapping-alist))
-
-)
-
-(defvar thai-current-keyboard-type nil
- "Thai Keyboard type which Quail is assuming currently.
-This variable is used in Quail internally only.")
-
-;; Template of a cdr part of a Quail map when a consonant is entered.
-(defvar thai-consonant-alist nil)
-;; Template of a cdr part of a Quail map when a vowel upper or a vowel
-;; lower is entered.
-(defvar thai-vowel-upper-lower-alist nil)
-
-;; Return a Quail map corresponding to KEY of length LEN.
-;; The car part of the map is a translation generated automatically.
-;; The cdr part of the map is a copy of ALIST.
-(defun thai-generate-quail-map (key len alist)
- (let ((str "")
- (idx 0))
- (while (< idx len)
- (setq str (concat str (aref (nth 1 (thai-keyboard-info
- thai-current-keyboard-type))
- (aref key idx)))
- idx (1+ idx)))
- (cons (string-to-char (compose-string str)) (copy-alist alist))))
-
-;; Return a Quail map corresponding to KEY of length LEN when Thai
-;; tone mark is entered.
-(defun thai-tone-input (key len)
- (thai-generate-quail-map key len nil))
-
-;; Return a Quail map corresponding to KEY of length LEN when Thai
-;; vowel upper or vowel lower is entered.
-(defun thai-vowel-upper-lower-input (key len)
- (thai-generate-quail-map
- key len
- (nth 3 (thai-keyboard-info thai-current-keyboard-type))))
-
-;; Define RULES in Quail map. In addition, create
-;; `thai-consonant-alist-KEYBOARD-TYPE' and
-;; `thai-vowel-upper-lower-alist-KEYBOARD-TYPE'.
-
-;; The general composing rules are as follows:
-;;
-;; T
-;; V T V T
-;; CV -> C, CT -> C, CVT -> C, Cv -> C, CvT -> C
-;; v v
-;;
-;; where C: consonant, V: vowel upper, v: vowel lower, T: tone mark.
-
-(defmacro thai-quail-define-rules (keyboard-type &rest rules)
- (let ((l rules)
- consonant-alist
- vowel-upper-lower-alist
- rule trans ch c-set)
- (while l
- (setq rule (car l))
- (setq trans (nth 1 rule))
- (if (consp trans)
- (setq trans (car trans)))
- (setq c-set (char-category-set (string-to-char trans)))
- (cond ((or (aref c-set ?2)
- (aref c-set ?3))
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'thai-vowel-upper-lower-input)
- consonant-alist)))
- ((aref c-set ?4)
- (setq consonant-alist
- (cons (cons (string-to-char (car rule))
- 'thai-tone-input)
- consonant-alist)
- vowel-upper-lower-alist
- (cons (cons (string-to-char (car rule))
- 'thai-tone-input)
- vowel-upper-lower-alist))))
- (setq l (cdr l)))
- `(progn
- (quail-define-rules ,@rules)
- (setcar (nthcdr 2 (thai-keyboard-info ,keyboard-type))
- ',consonant-alist)
- (setcar (nthcdr 3 (thai-keyboard-info ,keyboard-type))
- ',vowel-upper-lower-alist))))
-
-;; Return an alist which can be a cdr part of a Quail map
-;; corresponding to the current key when Thai consonant is entered.
-(defun thai-consonant-input (key len)
- (let ((quail-package-name (quail-name)))
- (setq thai-current-keyboard-type
- (cond ((string= quail-package-name "thai-pattachote") 'pattachote)
- ((string= quail-package-name "thai-kesmanee") 'kesmanee)
- (t (error "Invalid Quail package %s" quail-package-name))))
- (copy-alist (nth 2 (thai-keyboard-info thai-current-keyboard-type)))))
-\f
;; Thai Kesmanee keyboard support.
(quail-define-package
'\e,T_\e(B' and '\e,To\e(B' are assigned to '\\' and '|' respectively,
'\e,T#\e(B' and '\e,T%\e(B' are assigned to '`' and '~' respectively,
Don't know where to assign characters '\e,Tz\e(B' and '\e,T{\e(B'."
- nil t t nil t nil nil nil nil nil t)
-
-(thai-quail-define-rules 'kesmanee
- ("1" ("\e,TE\e(B" . thai-consonant-input))
- ("!" "#")
- ("2" "/")
- ("@" "\e,Tq\e(B")
- ("3" "_")
- ("#" "\e,Tr\e(B")
- ("4" ("\e,T@\e(B" . thai-consonant-input))
- ("$" "\e,Ts\e(B")
- ("5" ("\e,T6\e(B" . thai-consonant-input))
- ("%" "\e,Tt\e(B")
- ("6" "\e,TX\e(B")
- ("^" "\e,TY\e(B")
- ("7" "\e,TV\e(B")
- ("&" "\e0\e,TQi\e1\e(B")
- ("8" ("\e,T$\e(B" . thai-consonant-input))
- ("*" "\e,Tu\e(B")
- ("9" ("\e,T5\e(B" . thai-consonant-input))
- ("\(" "\e,Tv\e(B")
- ("0" ("\e,T(\e(B" . thai-consonant-input))
- ("\)" "\e,Tw\e(B")
- ("-" ("\e,T"\e(B" . thai-consonant-input))
- ("_" "\e,Tx\e(B")
- ("=" ("\e,T*\e(B" . thai-consonant-input))
- ("+" "\e,Ty\e(B")
- ("\\" "\e,T_\e(B")
- ("|" "\e,To\e(B")
- ("`" ("\e,T#\e(B" . thai-consonant-input))
- ("~" ("\e,T%\e(B" . thai-consonant-input))
- ("q" "\e,Tf\e(B")
- ("Q" "\e,Tp\e(B")
- ("w" "\e,Td\e(B")
- ("W" "\"")
- ("e" "\e,TS\e(B")
- ("E" ("\e,T.\e(B" . thai-consonant-input))
- ("r" ("\e,T>\e(B" . thai-consonant-input))
- ("R" ("\e,T1\e(B" . thai-consonant-input))
- ("t" "\e,TP\e(B")
- ("T" ("\e,T8\e(B" . thai-consonant-input))
- ("y" "\e,TQ\e(B")
- ("Y" "\e,Tm\e(B")
- ("u" "\e,TU\e(B")
- ("U" "\e,Tj\e(B")
- ("i" ("\e,TC\e(B" . thai-consonant-input))
- ("I" ("\e,T3\e(B" . thai-consonant-input))
- ("o" ("\e,T9\e(B" . thai-consonant-input))
- ("O" "\e,TO\e(B")
- ("p" ("\e,TB\e(B" . thai-consonant-input))
- ("P" ("\e,T-\e(B" . thai-consonant-input))
- ("\[" ("\e,T:\e(B" . thai-consonant-input))
- ("{" ("\e,T0\e(B" . thai-consonant-input))
- ("\]" ("\e,TE\e(B" . thai-consonant-input))
- ("}" ",")
+ nil t t nil t nil nil nil 'quail-thai-update-translation nil t)
+
+(quail-install-map
+ (thai-generate-quail-map
+ [
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
+ 0 "#" "\e,TF\e(B" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,TQi\e(B" "\e,T'\e(B" ; SPC .. '
+ "\e,Tv\e(B" "\e,Tw\e(B" "\e,Tu\e(B" "\e,Ty\e(B" "\e,TA\e(B" "\e,T"\e(B" "\e,Tc\e(B" "\e,T=\e(B" ; ( .. /
+ "\e,T(\e(B" "\e,TE\e(B" "/" "_" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B" ; 0 .. 7
+ "\e,T$\e(B" "\e,T5\e(B" "\e,T+\e(B" "\e,TG\e(B" "\e,T2\e(B" "\e,T*\e(B" "\e,TL\e(B" "\e,TF\e(B" ; 8 .. ?
+ "\e,Tq\e(B" "\e,TD\e(B" "\e,TZ\e(B" "\e,T)\e(B" "\e,T/\e(B" "\e,T.\e(B" "\e,Tb\e(B" "\e,T,\e(B" ; @ .. G
+ "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "\e,Tn\e(B" "\e,Tl\e(B" "\e,TO\e(B" ; H .. O
+ "\e,T-\e(B" "\e,Tp\e(B" "\e,T1\e(B" "\e,T&\e(B" "\e,T8\e(B" "\e,Tj\e(B" "\e,TN\e(B" "\"" ; P .. W
+ ")" "\e,Tm\e(B" "(" "\e,T:\e(B" "\e,T_\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B" ; X .. _
+ "\e,T#\e(B" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B" ; ` .. g
+ "\e,Ti\e(B" "\e,TC\e(B" "\e,Th\e(B" "\e,TR\e(B" "\e,TJ\e(B" "\e,T7\e(B" "\e,TW\e(B" "\e,T9\e(B" ; h .. o
+ "\e,TB\e(B" "\e,Tf\e(B" "\e,T>\e(B" "\e,TK\e(B" "\e,TP\e(B" "\e,TU\e(B" "\e,TM\e(B" "\e,Td\e(B" ; p .. w
+ "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,To\e(B" "." "\e,T%\e(B" 0 ; x .. DEL
+ ]))
- ("a" ("\e,T?\e(B" . thai-consonant-input))
- ("A" "\e,TD\e(B")
- ("s" ("\e,TK\e(B" . thai-consonant-input))
- ("S" ("\e,T&\e(B" . thai-consonant-input))
- ("d" ("\e,T!\e(B" . thai-consonant-input))
- ("D" ("\e,T/\e(B" . thai-consonant-input))
- ("f" ("\e,T4\e(B" . thai-consonant-input))
- ("F" "\e,Tb\e(B")
- ("g" "\e,T`\e(B")
- ("G" ("\e,T,\e(B" . thai-consonant-input))
- ("h" "\e,Ti\e(B")
- ("H" "\e,Tg\e(B")
- ("j" "\e,Th\e(B")
- ("J" "\e,Tk\e(B")
- ("k" "\e,TR\e(B")
- ("K" ("\e,TI\e(B" . thai-consonant-input))
- ("l" ("\e,TJ\e(B" . thai-consonant-input))
- ("L" ("\e,TH\e(B" . thai-consonant-input))
- ("\;" ("\e,TG\e(B" . thai-consonant-input))
- (":" ("\e,T+\e(B" . thai-consonant-input))
- ("'" ("\e,T'\e(B" . thai-consonant-input))
- ("\"" ".")
-
- ("z" ("\e,T<\e(B" . thai-consonant-input))
- ("Z" "(")
- ("x" ("\e,T;\e(B" . thai-consonant-input))
- ("X" ")")
- ("c" "\e,Ta\e(B")
- ("C" ("\e,T)\e(B" . thai-consonant-input))
- ("v" ("\e,TM\e(B" . thai-consonant-input))
- ("V" ("\e,TN\e(B" . thai-consonant-input))
- ("b" "\e,TT\e(B")
- ("B" "\e,TZ\e(B")
- ("n" "\e,TW\e(B")
- ("N" "\e,Tl\e(B")
- ("m" ("\e,T7\e(B" . thai-consonant-input))
- ("M" "\e,Tn\e(B")
- ("," ("\e,TA\e(B" . thai-consonant-input))
- ("<" ("\e,T2\e(B" . thai-consonant-input))
- ("." "\e,Tc\e(B")
- (">" ("\e,TL\e(B" . thai-consonant-input))
- ("/" ("\e,T=\e(B" . thai-consonant-input))
- ("?" "\e,TF\e(B")
- )
\f
;; Thai Pattachote keyboard support.
(quail-define-package
"thai-pattachote" "Thai" "\e,T!;\e(B>" t
"Thai Pattachote input method with TIS620 keyboard layout"
- nil t t nil t nil nil nil nil nil t)
-
-(thai-quail-define-rules 'pattachote
- ("1" "=")
- ("!" "+")
- ("2" "\e,Tr\e(B")
- ("@" "\"")
- ("3" "\e,Ts\e(B")
- ("#" "/")
- ("4" "\e,Tt\e(B")
- ("$" ",")
- ("5" "\e,Tu\e(B")
- ("%" "?")
- ("6" "\e,TY\e(B")
- ("^" "\e,TX\e(B")
- ("7" "\e,Tw\e(B")
- ("&" "_")
- ("8" "\e,Tx\e(B")
- ("*" ".")
- ("9" "\e,Ty\e(B")
- ("(" "(")
- ("0" "\e,Tp\e(B")
- (")" ")")
- ("-" "\e,Tq\e(B")
- ("_" "-")
- ("=" "\e,Tv\e(B")
- ("+" "%")
- ("\\" "\e,TZ\e(B")
- ("|" "\e,Tm\e(B")
- ("`" ("\e,T#\e(B" . thai-consonant-input))
- ("~" ("\e,T%\e(B" . thai-consonant-input))
-
- ("q" "\e,Tg\e(B")
- ("Q" "\e,Tj\e(B")
- ("w" ("\e,T5\e(B" . thai-consonant-input))
- ("W" "\e,TD\e(B")
- ("e" ("\e,TB\e(B" . thai-consonant-input))
- ("E" "\e,Tf\e(B")
- ("r" ("\e,TM\e(B" . thai-consonant-input))
- ("R" ("\e,T-\e(B" . thai-consonant-input))
- ("t" ("\e,TC\e(B" . thai-consonant-input))
- ("T" ("\e,TI\e(B" . thai-consonant-input))
- ("y" "\e,Th\e(B")
- ("Y" "\e,TV\e(B")
- ("u" ("\e,T4\e(B" . thai-consonant-input))
- ("U" ("\e,T=\e(B" . thai-consonant-input))
- ("i" ("\e,TA\e(B" . thai-consonant-input))
- ("I" ("\e,T+\e(B" . thai-consonant-input))
- ("o" ("\e,TG\e(B" . thai-consonant-input))
- ("O" ("\e,T6\e(B" . thai-consonant-input))
- ("p" "\e,Ta\e(B")
- ("P" ("\e,T2\e(B" . thai-consonant-input))
- ("\[" "\e,Tc\e(B")
- ("{" "\e,TO\e(B")
- ("\]" ("\e,T2\e(B" . thai-consonant-input))
- ("}" "\e,TF\e(B")
-
- ("a" "\e,Ti\e(B")
- ("A" "\e,Tk\e(B")
- ("s" ("\e,T7\e(B" . thai-consonant-input))
- ("S" ("\e,T8\e(B" . thai-consonant-input))
- ("d" ("\e,T'\e(B" . thai-consonant-input))
- ("D" "\e,TS\e(B")
- ("f" ("\e,T!\e(B" . thai-consonant-input))
- ("F" ("\e,T3\e(B" . thai-consonant-input))
- ("g" "\e,TQ\e(B")
- ("G" "\e,Tl\e(B")
- ("h" "\e,TU\e(B")
- ("H" "\e,TW\e(B")
- ("j" "\e,TR\e(B")
- ("J" ("\e,T<\e(B" . thai-consonant-input))
- ("k" ("\e,T9\e(B" . thai-consonant-input))
- ("K" ("\e,T*\e(B" . thai-consonant-input))
- ("l" "\e,T`\e(B")
- ("L" "\e,Tb\e(B")
- (";" "\e,Td\e(B")
- (":" ("\e,T&\e(B" . thai-consonant-input))
- ("'" ("\e,T"\e(B" . thai-consonant-input))
- ("\"" ("\e,T1\e(B" . thai-consonant-input))
-
- ("z" ("\e,T:\e(B" . thai-consonant-input))
- ("Z" ("\e,T.\e(B" . thai-consonant-input))
- ("x" ("\e,T;\e(B" . thai-consonant-input))
- ("X" ("\e,T.\e(B" . thai-consonant-input))
- ("c" ("\e,TE\e(B" . thai-consonant-input))
- ("C" ("\e,T0\e(B" . thai-consonant-input))
- ("v" ("\e,TK\e(B" . thai-consonant-input))
- ("V" ("\e,T@\e(B" . thai-consonant-input))
- ("b" "\e,TT\e(B")
- ("B" "\e,TQ\e(B")
- ("n" ("\e,T$\e(B" . thai-consonant-input))
- ("N" ("\e,TH\e(B" . thai-consonant-input))
- ("m" ("\e,TJ\e(B" . thai-consonant-input))
- ("M" ("\e,TN\e(B" . thai-consonant-input))
- ("," "\e,TP\e(B")
- ("<" ("\e,T?\e(B" . thai-consonant-input))
- ("." ("\e,T(\e(B" . thai-consonant-input))
- (">" ("\e,T2\e(B" . thai-consonant-input))
- ("/" ("\e,T>\e(B" . thai-consonant-input))
- ("?" ("\e,TL\e(B" . thai-consonant-input))
- )
-
-;;; quail/thai.el ends here
+ nil t t nil t nil nil nil 'quail-thai-update-translation nil t)
+
+(quail-install-map
+ (thai-generate-quail-map
+ [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
+ 0 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. '
+ "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. /
+ "\e,Tp\e(B" "=" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,Tu\e(B" "\e,TY\e(B" "\e,Tw\e(B" ; 0 .. 7
+ "\e,Tx\e(B" "\e,Ty\e(B" "\e,T&\e(B" "\e,Td\e(B" "\e,T?\e(B" "\e,Tv\e(B" "\e,T2\e(B" "\e,TL\e(B" ; 8 .. ?
+ "\"" "\e,Tk\e(B" "\e,TQ\e(B" "\e,T0\e(B" "\e,TS\e(B" "\e,Tf\e(B" "\e,T3\e(B" "\e,Tl\e(B" ; @ .. G
+ "\e,TW\e(B" "\e,T+\e(B" "\e,T<\e(B" "\e,T*\e(B" "\e,Tb\e(B" "\e,TN\e(B" "\e,TH\e(B" "\e,T6\e(B" ; H .. O
+ "\e,T2\e(B" "\e,Tj\e(B" "\e,T-\e(B" "\e,T8\e(B" "\e,TI\e(B" "\e,T=\e(B" "\e,T@\e(B" "\e,TD\e(B" ; P .. W
+ "\e,T.\e(B" "\e,TV\e(B" "\e,T.\e(B" "\e,Tc\e(B" "\e,TZ\e(B" "\e,T2\e(B" "\e,TX\e(B" "-" ; X .. _
+ "\e,T#\e(B" "\e,Ti\e(B" "\e,TT\e(B" "\e,TE\e(B" "\e,T'\e(B" "\e,TB\e(B" "\e,T!\e(B" "\e,TQ\e(B" ; ` .. g
+ "\e,TU\e(B" "\e,TA\e(B" "\e,TR\e(B" "\e,T9\e(B" "\e,T`\e(B" "\e,TJ\e(B" "\e,T$\e(B" "\e,TG\e(B" ; h .. o
+ "\e,Ta\e(B" "\e,Tg\e(B" "\e,TM\e(B" "\e,T7\e(B" "\e,TC\e(B" "\e,T4\e(B" "\e,TK\e(B" "\e,T5\e(B" ; p .. w
+ "\e,T;\e(B" "\e,Th\e(B" "\e,T:\e(B" "\e,TO\e(B" "\e,Tm\e(B" "\e,TF\e(B" "\e,T%\e(B" 0 ; x .. DEL
+ ]))
;;; Code:
(require 'quail)
-
-;;;
-;;; Functions for making some composite punctuations.
-;;;
-
-(defun tibetan-quail-bzhi-shad (&rest ignore)
- (quail-delete-region)
- (quail-delete-overlays)
- (insert (compose-chars ?\e$(7!>\e(B '(mr . ml) ?\x20 '(mr . ml) ?\e$(7!>\e(B))
- (throw 'quail-tag nil))
-
-(defun tibetan-quail-nyi-zla (&rest ignore)
- (quail-delete-region)
- (quail-delete-overlays)
- (insert (compose-chars ?\e$(7#R\e(B '(mr . ml) ?\e$(7#S\e(B))
- (throw 'quail-tag nil))
-
-(defun tibetan-quail-nyi-zla-phur-shad (&rest ignore)
- (quail-delete-region)
- (quail-delete-overlays)
- (insert (compose-chars ?\e$(7#R\e(B '(mr . ml) ?\e$(7#S\e(B '(bc . tl) ?\e$(7!I\e(B))
- (throw 'quail-tag nil))
-
-(defun tibetan-quail-nyi-zla-double (&rest ignore)
- (quail-delete-region)
- (quail-delete-overlays)
- (insert (compose-chars ?\e$(7#R\e(B '(mr . ml) ?\e$(7#S\e(B '(mr . ml) ?\e$(7#S\e(B))
- (throw 'quail-tag nil))
-
-(defun tibetan-quail-nyi-zla-triple (&rest ignore)
- (quail-delete-region)
- (quail-delete-overlays)
- (insert (compose-chars ?\e$(7#R\e(B '(mr . ml) ?\e$(7#S\e(B '(mr . ml) ?\e$(7#S\e(B '(mr . ml) ?\e$(7#S\e(B))
- (throw 'quail-tag nil))
-
-;;;
-;;; Setting-ups for Extended Wylie input.
-;;;
-
-(defun quail-tibetan-input-wylie (key &rest ignore)
- (let (pc)
- (quail-delete-region)
- (quail-delete-overlays)
- (setq pc (char-before (overlay-start quail-overlay))
- quail-current-str (tibetan-composition pc key))
- (if (not (bobp))
- (progn
- (delete-char -1)
- (insert (aref quail-current-str 0))
- (setq quail-current-str (substring quail-current-str 1))))
- (move-overlay quail-overlay (point) (point))
- (insert quail-current-str)
- (throw 'quail-tag nil)))
-
+(require 'tibet-util)
+
+;; Now quail-current-key is set to Tibetan-Roman transcription. We
+;; set quail-current-str to the corresponding Tibetan string (composed
+;; if necessary). Both Wylie and TibKey input methods use this
+;; function.
+
+(defun quail-tibetan-update-translation (control-flag)
+ (if (numberp control-flag)
+ ;; Non-composable-character typed.
+ (setq quail-current-str
+ (buffer-substring (overlay-start quail-overlay)
+ (overlay-end quail-overlay))
+ unread-command-events
+ (string-to-list
+ (substring quail-current-key control-flag)))
+ ;; Special treatment of "-d..." and "-y...".
+ (if (string-match "^-[dy]" quail-current-key)
+ (setq quail-current-key (substring quail-current-key 1)))
+ (let ((str (tibetan-transcription-to-tibetan quail-current-key)))
+ ;; If quail-current-key is for punctuations, it can't be
+ ;; transcribed by tibetan-transcription-to-tibetan, thus STR
+ ;; contains ASCII string now. In that case, use the current
+ ;; characters set in quail-current-str.
+ (if (> (aref str 0) 255)
+ (setq quail-current-str (tibetan-compose-string str))
+ (or quail-current-str
+ (setq quail-current-str quail-current-key)))))
+ control-flag)
+
+;;; Wylie transcription based input methods.
+
+;; Special alist for `\e$(7"A\e(B'. It must be treated as a subjoined
+;; consonant if it follows a consonant.
+(defconst tibetan-wylie-quote-alist '(("'" . ?\e$(7"A\e(B)))
+
+;; Special alist to avoid default stacking.
+(defconst tibetan-wylie-non-stacking-alist
+ '(("-d" . "\e$(7"2\e(B")
+ ("-y" . "\e$(7"B\e(B")))
+
+;; Punctuations are not transcribed.
+
+(defconst tibetan-wylie-punctuation-alist
+ '(("." . " ")
+ (":" . "\e$(8"`\e(B")
+ (" " . "\e$(8!;\e(B")
+ ("/" . "\e$(8!=\e(B")
+ ("//" . "\e$(7!>\e(B")
+ ("////" . ["\e$(7!>\e(B \e$(7!>\e(B"])
+ ("$" . "\e$(8!?\e(B")
+ ("/\"" . "\e$(8!@\e(B") ; Not defined in Ext. Wylie.
+ ("&" . "\e$(8!@\e(B")
+ (";" . "\e$(8!A\e(B")
+ ("%" . "\e$(8!D\e(B")
+ ("!" . "\e$(7!8\e(B")
+ ("<" . "\e$(7!l\e(B")
+ (">" . "\e$(7!m\e(B")
+ ("@" . "\e$(7"f\e(B")
+ ("*" . ["\e$(7!4!5\e(B"])
+ ("#" . ["\e$(7!4!5!5\e(B"])
+ ("^" . "\e$(7!6\e(B")
+ ("0" . "\e$(7!P\e(B")
+ ("1" . "\e$(7!Q\e(B")
+ ("2" . "\e$(7!R\e(B")
+ ("3" . "\e$(7!S\e(B")
+ ("4" . "\e$(7!T\e(B")
+ ("5" . "\e$(7!U\e(B")
+ ("6" . "\e$(7!V\e(B")
+ ("7" . "\e$(7!W\e(B")
+ ("8" . "\e$(7!X\e(B")
+ ("9" . "\e$(7!Y\e(B")
+ ("-0" . "\e$(7!c\e(B")
+ ("-1" . "\e$(7!Z\e(B")
+ ("-2" . "\e$(7![\e(B")
+ ("-3" . "\e$(7!\\e(B")
+ ("-4" . "\e$(7!]\e(B")
+ ("-5" . "\e$(7!^\e(B")
+ ("-6" . "\e$(7!_\e(B")
+ ("-7" . "\e$(7!`\e(B")
+ ("-8" . "\e$(7!a\e(B")
+ ("-9" . "\e$(7!b\e(B")
+ ("|" . "\e$(7!1!2!3!9!:!B!C!E!F!G!H!I!J!K!L!M!N!O!d!f!h!j!k!n!o\e(B")))
(quail-define-package "tibetan-wylie" "Tibetan" "TIBw" t
"Tibetan character input by Extended Wylie key assignment.
+-------------------------------------+
- |\e2\e$(7"!`#T\e(B\e1\e$(8!;\e(B k |\e2\e$(7""`#T\e(B\e1\e$(8!;\e(B kh |\e2\e$(7"#`#T\e(B\e1\e$(8!;\e(B g |\e2\e$(7"$`#T\e(B\e1\e$(8!;\e(B gh |\e2\e$(7"%`#T\e(B\e1\e$(8!;\e(B ng| \e$(7"S\e(B i \e$(8!=\e(B /
- |\e2\e$(7"&`#T\e(B\e1\e$(8!;\e(B c |\e2\e$(7"'`#T\e(B\e1\e$(8!;\e(B ch |\e2\e$(7"(`#T\e(B\e1\e$(8!;\e(B j | |\e$(7"*\e$(8!;\e(B ny| \e$(7"U\e(B u \e$(7!>\e(B //
- |\e$(7"+\e$(8!;\e(B T |\e$(7",\e$(8!;\e(B TH |\e$(7"-\e$(8!;\e(B D |\e$(7".\e$(8!;\e(B DH |\e$(7"/\e$(8!;\e(B N | \e$(7"[\e(B e \e2\e$(7!>P\e(B P\e$(7!>\e(B\e1 ////
+ |\e$(7"!\e$(8!;\e(B k |\e$(7""\e$(8!;\e(B kh |\e$(7"#\e$(8!;\e(B g |\e$(7"$\e$(8!;\e(B gh |\e$(7"%\e$(8!;\e(B ng| \e$(7"S\e(B i \e$(8!=\e(B /
+ |\e$(7"&\e$(8!;\e(B c |\e$(7"'\e$(8!;\e(B ch |\e$(7"(\e$(8!;\e(B j | |\e$(7"*\e$(8!;\e(B ny| \e$(7"U\e(B u \e$(7!>\e(B //
+ |\e$(7"+\e$(8!;\e(B T |\e$(7",\e$(8!;\e(B TH |\e$(7"-\e$(8!;\e(B D |\e$(7".\e$(8!;\e(B DH |\e$(7"/\e$(8!;\e(B N | \e$(7"[\e(B e \e$(7!>\e(B \e$(7!>\e(B ////
|\e$(7"0\e$(8!;\e(B t |\e$(7"1\e$(8!;\e(B th |\e$(7"2\e$(8!;\e(B d |\e$(7"3\e$(8!;\e(B dh |\e$(7"4\e$(8!;\e(B n | \e$(7"]\e(B o \e$(7!A\e(B ;
|\e$(7"5\e$(8!;\e(B p |\e$(7"6\e$(8!;\e(B ph |\e$(7"7\e$(8!;\e(B b |\e$(7"8\e$(8!;\e(B bh |\e$(7"9\e$(8!;\e(B m | \e$(7"\\e(B ai (ee, E) \e$(8!?\e(B $
|\e$(7":\e$(8!;\e(B ts|\e$(7";\e$(8!;\e(B tsh|\e$(7"<\e$(8!;\e(B dz |\e$(7"=\e$(8!;\e(B dzh|\e$(7">\e$(8!;\e(B w | \e$(7"^\e(B au (oo, O) \e$(8!@\e(B &
- |\e$(7"?\e$(8!;\e(B zh|\e$(7"@\e$(8!;\e(B z |\e$(7"A\e$(8!;\e(B ' | |\e$(7"B\e$(8!;\e(B y | \e$(7"a\e(B I \e2\e$(7#RP#SP#S\e(B\e1 *
- |\e$(7"C\e$(8!;\e(B r |\e$(7"D\e$(8!;\e(B l |\e$(7"E\e$(8!;\e(B sh |\e$(7"F\e$(8!;\e(B SH |\e$(7"G\e$(8!;\e(B s | \e$(7"`\e(B : \e2\e$(7#RP#SP#SP#S\e(B\e1 #
+ |\e$(7"?\e$(8!;\e(B zh|\e$(7"@\e$(8!;\e(B z |\e$(7"A\e$(8!;\e(B ' | |\e$(7"B\e$(8!;\e(B y | \e$(7"a\e(B I \e$(7#R#S#S\e(B *
+ |\e$(7"C\e$(8!;\e(B r |\e$(7"D\e$(8!;\e(B l |\e$(7"E\e$(8!;\e(B sh |\e$(7"F\e$(8!;\e(B SH |\e$(7"G\e$(8!;\e(B s | \e$(7"`\e(B : \e$(7#R#S#S#S\e(B #
|\e$(7"H\e$(8!;\e(B h |\e$(7"I\e$(8!;\e(B A |\e$(7"J\e$(8!;\e(B kSH| | | \e$(7"_\e(B M \e$(7!l\e(B \e$(7!m\e(B < >
+-------------------------------------+ \e$(8!D\e(B %
(The consonant \e$(7"I\e$(8!;\e(B must be typed explicitly.)
NOT SPECIFIED IN EXT. WYLIE:
+--------------------------------------------------------+
- |\e$(7"c\e(B = ~ |\e$(7"d\e(B = ` |\e$(7"e\e(B = , |\e$(7"f\e(B = @ |\e$(7!g\e(B = _o|\e$(7!e\e(B = _O|\e2\e$(7#RP#S_!I\e(B\e1 = ^|
+ |\e$(7"c\e(B = ~ |\e$(7"d\e(B = ` |\e$(7"e\e(B = , |\e$(7"f\e(B = @ |\e$(7!g\e(B = _o|\e$(7!e\e(B = _O|\e$(7#R#S!I\e(B = ^|
+--------------------------------------------------------+
|\e$(7"i\e(B = x |\e$(7"j\e(B = X |\e$(7"g\e(B = v |\e$(7"h\e(B = V |\e$(7"k\e(B = q |\e$(7"l\e(B = Q |
+-----------------------------------------------+
Tsheg is assigned to SPC. Space is assigned to period '.'.
"
- nil nil nil)
-
-(quail-define-rules
- ("." ?\x20)
- ("k" quail-tibetan-input-wylie)
- ("g" quail-tibetan-input-wylie)
- ("c" quail-tibetan-input-wylie)
- ("j" quail-tibetan-input-wylie)
- ("T" quail-tibetan-input-wylie)
- ("D" quail-tibetan-input-wylie)
- ("N" quail-tibetan-input-wylie)
- ("t" quail-tibetan-input-wylie)
- ("d" quail-tibetan-input-wylie)
- ("n" quail-tibetan-input-wylie)
- ("p" quail-tibetan-input-wylie)
- ("b" quail-tibetan-input-wylie)
- ("m" quail-tibetan-input-wylie)
- ("w" quail-tibetan-input-wylie)
- ("z" quail-tibetan-input-wylie)
- ("'" quail-tibetan-input-wylie)
- ("y" quail-tibetan-input-wylie)
- ("r" quail-tibetan-input-wylie)
- ("l" quail-tibetan-input-wylie)
- ("SH" quail-tibetan-input-wylie)
- ("s" quail-tibetan-input-wylie)
- ("h" quail-tibetan-input-wylie)
- ("H" quail-tibetan-input-wylie)
- ("A" quail-tibetan-input-wylie)
- ("+k" quail-tibetan-input-wylie)
- ("+g" quail-tibetan-input-wylie)
- ("+c" quail-tibetan-input-wylie)
- ("+j" quail-tibetan-input-wylie)
- ("+T" quail-tibetan-input-wylie)
- ("+D" quail-tibetan-input-wylie)
- ("+N" quail-tibetan-input-wylie)
- ("+t" quail-tibetan-input-wylie)
- ("+d" quail-tibetan-input-wylie)
- ("+n" quail-tibetan-input-wylie)
- ("+p" quail-tibetan-input-wylie)
- ("+b" quail-tibetan-input-wylie)
- ("+m" quail-tibetan-input-wylie)
- ("+w" quail-tibetan-input-wylie)
- ("+z" quail-tibetan-input-wylie)
- ("+'" quail-tibetan-input-wylie)
- ("+y" quail-tibetan-input-wylie)
- ("+r" quail-tibetan-input-wylie)
- ("+l" quail-tibetan-input-wylie)
- ("+SH" quail-tibetan-input-wylie)
- ("+s" quail-tibetan-input-wylie)
- ("+h" quail-tibetan-input-wylie)
- ("+H" quail-tibetan-input-wylie)
- ("+A" quail-tibetan-input-wylie)
- ("-d" ?\e$(7"2\e(B) ; To avoid default stacking
- ("-y" ?\e$(7"B\e(B) ; Idem.
- ("a" quail-tibetan-input-wylie) ; invisible vowel sign
- ("i" quail-tibetan-input-wylie)
- ("u" quail-tibetan-input-wylie)
- ("e" quail-tibetan-input-wylie)
- ("o" quail-tibetan-input-wylie)
- ("I" quail-tibetan-input-wylie)
- ("E" quail-tibetan-input-wylie)
- ("O" quail-tibetan-input-wylie)
- ("M" quail-tibetan-input-wylie)
- ("~" quail-tibetan-input-wylie)
- ("`" quail-tibetan-input-wylie)
- ("," quail-tibetan-input-wylie)
- ("x" quail-tibetan-input-wylie)
- ("X" quail-tibetan-input-wylie)
- ("v" quail-tibetan-input-wylie)
- ("V" quail-tibetan-input-wylie)
- ("q" quail-tibetan-input-wylie)
- ("Q" quail-tibetan-input-wylie)
- ("_o" quail-tibetan-input-wylie)
- ("_O" quail-tibetan-input-wylie)
-;;; ("_/" quail-tibetan-input-wylie)
- (":" ?\e$(8"`\e(B)
- (" " ?\e$(8!;\e(B)
- ("/" ?\e$(8!=\e(B)
- ("//" ?\e$(7!>\e(B)
- ("////" tibetan-quail-bzhi-shad)
- ("$" ?\e$(8!?\e(B)
- ("/\"" ?\e$(8!@\e(B) ; Not defined in Ext. Wylie.
- ("&" ?\e$(8!@\e(B)
- (";" ?\e$(8!A\e(B)
- ("%" ?\e$(8!D\e(B)
- ("!" ?\e$(7!8\e(B)
- ("<" ?\e$(7!l\e(B)
- (">" ?\e$(7!m\e(B)
- ("@" ?\e$(7"f\e(B)
- ("*" tibetan-quail-nyi-zla-double)
- ("#" tibetan-quail-nyi-zla-triple)
- ("^" tibetan-quail-nyi-zla-phur-shad)
- ("0" ?\e$(7!P\e(B)
- ("1" ?\e$(7!Q\e(B)
- ("2" ?\e$(7!R\e(B)
- ("3" ?\e$(7!S\e(B)
- ("4" ?\e$(7!T\e(B)
- ("5" ?\e$(7!U\e(B)
- ("6" ?\e$(7!V\e(B)
- ("7" ?\e$(7!W\e(B)
- ("8" ?\e$(7!X\e(B)
- ("9" ?\e$(7!Y\e(B)
- ("-0" ?\e$(7!c\e(B)
- ("-1" ?\e$(7!Z\e(B)
- ("-2" ?\e$(7![\e(B)
- ("-3" ?\e$(7!\\e(B)
- ("-4" ?\e$(7!]\e(B)
- ("-5" ?\e$(7!^\e(B)
- ("-6" ?\e$(7!_\e(B)
- ("-7" ?\e$(7!`\e(B)
- ("-8" ?\e$(7!a\e(B)
- ("-9" ?\e$(7!b\e(B)
- ("|" "\e$(7!1!2!3!9!:!B!C!E!F!G!H!I!J!K!L!M!N!O!d!f!h!j!k!n!o\e(B")
- )
+ nil nil nil nil nil nil nil nil
+ 'quail-tibetan-update-translation)
+
+;; Here we build up a Quail map for a Tibtan sequence the whole of
+;; which can be one composition.
+;;
+;; A Tibetan syllable is typically structured as follows:
+;; [P] C [c+] V [M] [S [s]]
+;; ^^^^^^^^^^^^
+;; where P:prefix, C:base consonant, c:subjoined consonant,
+;; V:vowel, M:vowel modifier, S:suffix, s:post suffix.
+;; In this pattern, the part indicated by "^^^" can be one composition.
+
+(quail-install-map
+ (quail-map-from-table
+ '((base-state (tibetan-consonant-transcription-alist . sq-state)
+ (tibetan-precomposed-transcription-alist . s-state)
+ (tibetan-wylie-non-stacking-alist . sq-state)
+ tibetan-subjoined-transcription-alist
+ tibetan-vowel-transcription-alist
+ tibetan-modifier-transcription-alist
+ tibetan-wylie-punctuation-alist)
+ (sq-state (tibetan-wylie-quote-alist . s-state)
+ (tibetan-subjoined-transcription-alist . s-state))
+ (s-state (tibetan-subjoined-transcription-alist . s-state)
+ (tibetan-vowel-transcription-alist . m-state))
+ (m-state tibetan-modifier-transcription-alist))))
;;;
-;;; Setting-ups for TibKey input
+;;; TibKey key alignment based input method
;;;
(defconst tibetan-tibkey-to-transcription-alist
- '(
+ '(;; consonant
("`" . "`") ; sna ldan
("~" . "~") ; sna ldan + nada
("q" . "k") ; ka
("," . "s") ; sa
("." . "h") ; ha
("/" . "A") ; Aa
- ;;subjoined
+ ;; subjoined
("hq" . "+k") ; ka
("hQ" ."+kSH") ; kSHa
("hw" . "+kh") ; kha
("h," . "+s") ; sa
("h." . "+h") ; ha
("h/" . "+A") ; Aa
+ ;; Special rule for `\e$(7"B\e(B' to avoid stacking.
+ ("E" . "-y")
))
-(defun quail-tibetan-input-tibkey (key &rest ignore)
- (let (trans pc)
- (setq trans (cdr (assoc key tibetan-tibkey-to-transcription-alist)))
- (quail-delete-region)
- (quail-delete-overlays)
- (setq pc (char-before (overlay-start quail-overlay))
- quail-current-str (tibetan-composition pc trans))
- (if (not (bobp))
- (progn
- (delete-char -1)
- (insert (aref quail-current-str 0))
- (setq quail-current-str (substring quail-current-str 1))))
- (move-overlay quail-overlay (point) (point))
- (insert quail-current-str)
- (throw 'quail-tag nil)))
-
+(defconst tibetan-consonant-tibkey-alist nil)
+(defconst tibetan-subjoined-tibkey-alist nil)
+(defconst tibetan-vowel-tibkey-alist nil)
+(defconst tibetan-modifier-tibkey-alist nil)
+(defconst tibetan-non-stacking-tibkey-alist nil)
+
+(let ((type-list '("consonant" "subjoined" "vowel" "modifier" "non-stacking"))
+ (tail tibetan-tibkey-to-transcription-alist)
+ elt)
+ (while tail
+ (setq elt (car tail) tail (cdr tail))
+ (let ((types type-list)
+ type transcription trans-alist tibkey-alist)
+ (while types
+ (setq type (car types) types (cdr types))
+ (setq trans-alist
+ (if (string= type "non-stacking")
+ 'tibetan-wylie-non-stacking-alist
+ (intern (format "tibetan-%s-transcription-alist" type)))
+ transcription
+ (cdr (assoc (cdr elt) (symbol-value trans-alist))))
+ (when transcription
+ (setq tibkey-alist (intern (format "tibetan-%s-tibkey-alist" type)))
+ (set tibkey-alist
+ (cons (cons (car elt) transcription)
+ (symbol-value tibkey-alist)))))
+ (or tibkey-alist
+ (error "No Tibetan transcription for %s" (cdr elt))))))
+
+(defconst tibetan-punctuation-tibkey-alist
+ '(("1" . "\e$(7!Q\e(B")
+ ("!" . ["\e$(7#R#S#S#S\e(B"]) ; nyi zla long
+ ("2" . "\e$(7!R\e(B")
+ ("@" . "\e$(7#S\e(B") ; nyi zla simple
+ ("3" . "\e$(7!S\e(B")
+;;; ("#" )
+ ("4" . "\e$(7!T\e(B")
+;;; ("$" )
+ ("5" . "\e$(7!U\e(B")
+ ("%" . "\e$(8!D\e(B")
+ ("6" . "\e$(7!V\e(B")
+ ("^" . "\e$(7!1\e(B")
+ ("7" . "\e$(7!W\e(B")
+ ("8" . "\e$(7!X\e(B")
+;;; ("*" ) ; avagraha, not supported yet
+ ("9" . "\e$(7!Y\e(B")
+ ("(" . "\e$(7!l\e(B")
+ ("0" . "\e$(7!P\e(B")
+ (")" . "\e$(7!m\e(B")
+;;; ("-" ) ; enphatic, not yet supported
+;;; ("_" ) ; id.
+;;; ("=" ) ; special sign, not yet supported
+ ("+" . "\e$(8!A\e(B")
+ ("\\" . "\e$(8!?\e(B")
+ ("|" . "\e$(7!8\e(B")
+ ("I" . "\e$(7"f\e(B") ; avagraha
+ (":" . "\e$(8"`\e(B")
+;;; (">" ?\e$(8!;\e(B) ; to be assigned to SPC
+ (">" . " ")
+ ("?" . "\e$(8!=\e(B")
+ ("??" . "\e$(7!>\e(B")
+ ("????" . ["\e$(7!>\e(B \e$(7!>\e(B"])
+ (" " . "\e$(8!;\e(B")
+ ))
+;; Convert TibKey string to Tibetan-Roman transcription string.
+;; If there's no proper conversion, return nil.
+(defun quail-tibkey-to-transcription (tibkey)
+ (let ((len (length tibkey))
+ (i 0)
+ (trans-list nil))
+ (while (< i len)
+ (let ((last len)
+ trans)
+ (while (and (not trans) (> last i))
+ (or (setq trans (cdr (assoc (substring tibkey i last)
+ tibetan-tibkey-to-transcription-alist)))
+ (setq last (1- last))))
+ (if trans
+ (setq trans-list (cons trans trans-list)
+ i last)
+ (setq trans-list nil i len))))
+ (apply 'concat (nreverse trans-list))))
+
+(defvar quail-tibkey-characters nil)
+
+(defun quail-tibkey-update-translation (control-flag)
+ (if (integerp control-flag)
+ ;; Non-composable-character typed.
+ (setq quail-current-str
+ (buffer-substring (overlay-start quail-overlay)
+ (overlay-end quail-overlay))
+ unread-command-events
+ (string-to-list
+ (substring quail-current-key control-flag)))
+ (let ((transcription (quail-tibkey-to-transcription quail-current-key)))
+ (if (> (length transcription) 0)
+ (let ((quail-current-key transcription))
+ (setq control-flag
+ (quail-tibetan-update-translation control-flag)))
+ (or quail-current-str
+ (setq quail-current-str quail-current-key)))))
+ control-flag)
(quail-define-package "tibetan-tibkey" "Tibetan" "TIBt" t
"Tibetan character input by TibKey key assignment.
-(This implementation is still incomplete.
+\(This implementation is still incomplete.
Therefore, the following key assignment is a provisional one.)
[NOT SHIFTED]
[SHIFTED]
+----------------------------------------------------------+
- |~\e$(7"c\e(B|!\e2\e$(7#RP#S\e(B\e1|@\e$(7#S\e(B|# |$ |%\e$(8!D\e(B |^\e$(7!1\e(B|& |* |(\e$(7!l\e(B|)\e$(7!m\e(B|_ |+\e$(7!A\e(B| |\e$(7!8\e(B|
+ |~\e$(7"c\e(B|!\e$(7#R#S\e(B|@\e$(7#S\e(B|# |$ |%\e$(8!D\e(B |^\e$(7!1\e(B|& |* |(\e$(7!l\e(B|)\e$(7!m\e(B|_ |+\e$(7!A\e(B| |\e$(7!8\e(B|
+----------------------------------------------------------+
|Q\e$(7"J\e(B|W\e$(7#T\e(B|E |R |T\e$(7"a\e(B|Y |U |I\e$(7"f\e(B|O\e$(7"+\e(B|P\e$(7",\e(B|{\e$(7"-\e(B|}\e$(7"/\e(B|
+-----------------------------------------------+
current implementation (especially special signs). I hope
I'll complete in a future revision.
"
- nil t)
-
-(quail-define-rules
- ("`" quail-tibetan-input-tibkey) ; sna ldan, not supported yet
- ("~" quail-tibetan-input-tibkey) ; sna ldan + nada
- ("1" ?\e$(7!Q\e(B)
- ("!" tibetan-quail-nyi-zla) ; nyi zla long
- ("2" ?\e$(7!R\e(B)
- ("@" ?\e$(7#S\e(B) ; nyi zla simple
- ("3" ?\e$(7!S\e(B)
-;;; ("#" )
- ("4" ?\e$(7!T\e(B)
-;;; ("$" )
- ("5" ?\e$(7!U\e(B)
- ("%" ?\e$(8!D\e(B)
- ("6" ?\e$(7!V\e(B)
- ("^" ?\e$(7!1\e(B)
- ("7" ?\e$(7!W\e(B)
- ("8" ?\e$(7!X\e(B)
-;;; ("*" ) ; avagraha, not supported yet
- ("9" ?\e$(7!Y\e(B)
- ("(" ?\e$(7!l\e(B)
- ("0" ?\e$(7!P\e(B)
- (")" ?\e$(7!m\e(B)
-;;; ("-" ) ; enphatic, not yet supported
-;;; ("_" ) ; id.
-;;; ("=" ) ; special sign, not yet supported
- ("+" ?\e$(8!A\e(B)
- ("\\" ?\e$(8!?\e(B)
- ("|" ?\e$(7!8\e(B)
- ("q" quail-tibetan-input-tibkey) ; ka
- ("Q" quail-tibetan-input-tibkey) ; kSHa
- ("w" quail-tibetan-input-tibkey) ; kha
- ("e" quail-tibetan-input-tibkey) ; ga
- ("E" ?\e$(7"B\e(B)
- ("r" quail-tibetan-input-tibkey) ; nga
- ("t" quail-tibetan-input-tibkey) ; ca
- ("T" quail-tibetan-input-tibkey) ; gi gu log
- ("y" quail-tibetan-input-tibkey) ; cha
- ("u" quail-tibetan-input-tibkey) ; ja
- ("i" quail-tibetan-input-tibkey) ; nya
- ("I" ?\e$(7"f\e(B) ; avagraha
- ("o" quail-tibetan-input-tibkey) ; ta
- ("O" quail-tibetan-input-tibkey) ; Ta
- ("p" quail-tibetan-input-tibkey) ; tha
- ("P" quail-tibetan-input-tibkey) ; THa
- ("[" quail-tibetan-input-tibkey) ; da
- ("{" quail-tibetan-input-tibkey) ; Da
- ("]" quail-tibetan-input-tibkey) ; na
- ("}" quail-tibetan-input-tibkey) ; Na
- ("a" quail-tibetan-input-tibkey) ; pa
- ("A" quail-tibetan-input-tibkey) ; Vowel sign a
- ("s" quail-tibetan-input-tibkey) ; pha
- ("d" quail-tibetan-input-tibkey) ; ba
-;;; ("D" ) ; special sign, not supported yet
- ("f" quail-tibetan-input-tibkey) ; ma
- ("F" quail-tibetan-input-tibkey) ; anusvara
- ("g" quail-tibetan-input-tibkey) ; zhabs kyu
- ("G" quail-tibetan-input-tibkey) ; gi gu
- ("H" quail-tibetan-input-tibkey) ; viraama
- ("j" quail-tibetan-input-tibkey) ; naro
- ("J" quail-tibetan-input-tibkey) ; 'greng bu
- ("k" quail-tibetan-input-tibkey);;tsa
-;;; ("K" ) ; tsadru, not supported yet
- ("l" quail-tibetan-input-tibkey) ; tsha
- (";" quail-tibetan-input-tibkey) ; dza
- (":" ?\e$(8"`\e(B)
- ("'" quail-tibetan-input-tibkey) ; wa
- ("\"" quail-tibetan-input-tibkey) ; wa zur
- ("z" quail-tibetan-input-tibkey) ; zha
- ("x" quail-tibetan-input-tibkey) ; za
- ("c" quail-tibetan-input-tibkey) ; 'a
- ("C" quail-tibetan-input-tibkey) ; 'a chung
- ("v" quail-tibetan-input-tibkey) ; ya
- ("V" quail-tibetan-input-tibkey) ; ya btags
- ("b" quail-tibetan-input-tibkey) ; ra
- ("B" quail-tibetan-input-tibkey) ; ra btags
- ("n" quail-tibetan-input-tibkey) ; la
- ("N" quail-tibetan-input-tibkey) ; la btags
- ("m" quail-tibetan-input-tibkey) ; sha
- ("M" quail-tibetan-input-tibkey) ; SHa
- ("," quail-tibetan-input-tibkey) ; sa
- ("." quail-tibetan-input-tibkey) ; ha
-;;; (">" ?\e$(8!;\e(B) ; to be assigned to SPC
- (">" ?\x20)
- ("/" quail-tibetan-input-tibkey) ; Aa
- ("?" ?\e$(8!=\e(B)
- ("??" ?\e$(7!>\e(B)
- ("????" tibetan-quail-bzhi-shad)
- (" " ?\e$(8!;\e(B)
- ;;subjoined
- ("hq" quail-tibetan-input-tibkey) ; ka
- ("hQ" quail-tibetan-input-tibkey) ; kSHa
- ("hw" quail-tibetan-input-tibkey) ; kha
- ("he" quail-tibetan-input-tibkey) ; ga
- ("hr" quail-tibetan-input-tibkey) ; nga
- ("ht" quail-tibetan-input-tibkey) ; ca
- ("hy" quail-tibetan-input-tibkey) ; cha
- ("hu" quail-tibetan-input-tibkey) ; ja
- ("hi" quail-tibetan-input-tibkey) ; nya
- ("ho" quail-tibetan-input-tibkey) ; ta
- ("hO" quail-tibetan-input-tibkey) ; Ta
- ("hp" quail-tibetan-input-tibkey) ; tha
- ("hP" quail-tibetan-input-tibkey) ; THa
- ("h[" quail-tibetan-input-tibkey) ; da
- ("h{" quail-tibetan-input-tibkey) ; Da
- ("h]" quail-tibetan-input-tibkey) ; na
- ("h}" quail-tibetan-input-tibkey) ; Na
- ("ha" quail-tibetan-input-tibkey) ; pa
- ("hs" quail-tibetan-input-tibkey) ; pha
- ("hd" quail-tibetan-input-tibkey) ; ba
- ("hf" quail-tibetan-input-tibkey) ; ma
- ("hk" quail-tibetan-input-tibkey) ; tsa
- ("hl" quail-tibetan-input-tibkey) ; tsha
- ("h;" quail-tibetan-input-tibkey) ; dza
- ("h'" quail-tibetan-input-tibkey) ; wa
- ("hz" quail-tibetan-input-tibkey) ; zha
- ("hx" quail-tibetan-input-tibkey) ; za
- ("hc" quail-tibetan-input-tibkey) ; 'a
- ("hv" quail-tibetan-input-tibkey) ; ya
- ("hb" quail-tibetan-input-tibkey) ; ra
- ("hn" quail-tibetan-input-tibkey) ; la
- ("hm" quail-tibetan-input-tibkey) ; sha
- ("hM" quail-tibetan-input-tibkey) ; SHa
- ("h," quail-tibetan-input-tibkey) ; sa
- ("h." quail-tibetan-input-tibkey) ; ha
- ("h/" quail-tibetan-input-tibkey) ; Aa
- )
-
-;;; quail/tibetan.el ends here.
-
-
-
+ nil nil nil nil nil nil nil nil
+ 'quail-tibkey-update-translation)
+
+(quail-install-map
+ (quail-map-from-table
+ '((base-state (tibetan-consonant-tibkey-alist . s-state)
+ (tibetan-non-stacking-tibkey-alist . s-state)
+ tibetan-subjoined-tibkey-alist
+ tibetan-vowel-tibkey-alist
+ tibetan-modifier-tibkey-alist
+ tibetan-punctuation-tibkey-alist)
+ (s-state (tibetan-subjoined-tibkey-alist . s-state)
+ (tibetan-vowel-tibkey-alist . m-state))
+ (m-state tibetan-modifier-tibkey-alist))))