1 ;;; its/thai.el --- Inputting Thai characters in Egg Input Method Architecture
3 ;; Copyright (C) 1999,2000 PFU LIMITED
5 ;; Author: KATAYAMA Yoshio <kate@pfu.co.jp>
7 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
9 ;; Keywords: mule, multilingual, input method
11 ;; This file is part of EGG.
13 ;; EGG is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; EGG is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
39 (defconst its-compaction-enable t))
42 (defmacro define-its-thai-keymap (&rest rule)
43 (let (input output type list)
45 (setq input (car (car rule))
46 output (nth 1 (car rule))
47 type (nth 2 (car rule))
49 list (cons `(its-defrule ,input ,output) list))
51 (setq list (cons `(setq ,type (cons (cons ,input ,output) ,type))
53 `(let (consonant vowel tone)
55 (its-thai-composit consonant vowel tone))))
57 (defun its-thai-composit (consonant vowel tone)
60 (setq keyseq (car (car consonant))
61 output (cdr (car consonant))
62 consonant (cdr consonant))
63 (its-thai-add-vowel keyseq output vowel tone)
64 (its-thai-add-tone keyseq output tone))))
66 (defun its-thai-add-vowel (keyseq output vowel tone)
67 (let (next-keyseq next-output)
69 (setq next-keyseq (concat keyseq (car (car vowel)))
70 next-output (concat output (cdr (car vowel)))
72 (its-defrule next-keyseq (compose-string next-output))
73 (its-thai-add-tone next-keyseq next-output tone))))
75 (defun its-thai-add-tone (keyseq output tone)
76 (let (next-keyseq next-output)
78 (setq next-keyseq (concat keyseq (car (car tone)))
79 next-output (concat output (cdr (car tone)))
81 (its-defrule next-keyseq (compose-string next-output))))))
83 ;; Thai Kesmanee keyboard support.
85 (define-its-state-machine its-thai-kesmanee-map
86 "kesmanee" "
\e,T!!
\e(B" Thai
87 "Map for Thai Kesmanee input method with TIS620 keyboard. (Thai)"
89 (define-its-thai-keymap
90 ("1" "
\e,TE
\e(B" consonant) ("!" "#")
91 ("2" "/") ("@" "
\e,Tq
\e(B")
92 ("3" "_") ("#" "
\e,Tr
\e(B")
93 ("4" "
\e,T@
\e(B" consonant) ("$" "
\e,Ts
\e(B")
94 ("5" "
\e,T6
\e(B" consonant) ("%" "
\e,Tt
\e(B")
95 ("6" "
\e,TX
\e(B" vowel) ("^" "
\e,TY
\e(B" vowel)
96 ("7" "
\e,TV
\e(B" vowel) ("&" "
\e0
\e,TQi
\e(B
\e1" vowel)
97 ("8" "
\e,T$
\e(B" consonant) ("*" "
\e,Tu
\e(B")
98 ("9" "
\e,T5
\e(B" consonant) ("(" "
\e,Tv
\e(B")
99 ("0" "
\e,T(
\e(B" consonant) (")" "
\e,Tw
\e(B")
100 ("-" "
\e,T"
\e(B" consonant) ("_" "
\e,Tx
\e(B")
101 ("=" "
\e,T*
\e(B" consonant) ("+" "
\e,Ty
\e(B")
102 ("\\" "
\e,T_
\e(B") ("|" "
\e,To
\e(B")
103 ("`" "
\e,T#
\e(B" consonant) ("~" "
\e,T%
\e(B" consonant)
105 ("q" "
\e,Tf
\e(B") ("Q" "
\e,Tp
\e(B")
106 ("w" "
\e,Td
\e(B") ("W" "\"")
107 ("e" "
\e,TS
\e(B") ("E" "
\e,T.
\e(B" consonant)
108 ("r" "
\e,T>
\e(B" consonant) ("R" "
\e,T1
\e(B" consonant)
109 ("T" "
\e,T8
\e(B" consonant) ("t" "
\e,TP
\e(B")
110 ("y" "
\e,TQ
\e(B" vowel) ("Y" "
\e,Tm
\e(B" tone)
111 ("u" "
\e,TU
\e(B" vowel) ("U" "
\e,Tj
\e(B" tone)
112 ("i" "
\e,TC
\e(B" consonant) ("I" "
\e,T3
\e(B" consonant)
113 ("o" "
\e,T9
\e(B" consonant) ("O" "
\e,TO
\e(B")
114 ("p" "
\e,TB
\e(B" consonant) ("P" "
\e,T-
\e(B" consonant)
115 ("[" "
\e,T:
\e(B" consonant) ("{" "
\e,T0
\e(B" consonant)
116 ("]" "
\e,TE
\e(B" consonant) ("}" ",")
118 ("a" "
\e,T?
\e(B" consonant) ("A" "
\e,TD
\e(B")
119 ("s" "
\e,TK
\e(B" consonant) ("S" "
\e,T&
\e(B" consonant)
120 ("d" "
\e,T!
\e(B" consonant) ("D" "
\e,T/
\e(B" consonant)
121 ("f" "
\e,T4
\e(B" consonant) ("F" "
\e,Tb
\e(B")
122 ("g" "
\e,T`
\e(B") ("G" "
\e,T,
\e(B" consonant)
123 ("h" "
\e,Ti
\e(B" tone) ("H" "
\e,Tg
\e(B" vowel)
124 ("j" "
\e,Th
\e(B" tone) ("J" "
\e,Tk
\e(B" tone)
125 ("k" "
\e,TR
\e(B") ("K" "
\e,TI
\e(B" consonant)
126 ("l" "
\e,TJ
\e(B" consonant) ("L" "
\e,TH
\e(B" consonant)
127 (";" "
\e,TG
\e(B" consonant) (":" "
\e,T+
\e(B" consonant)
128 ("'" "
\e,T'
\e(B" consonant) ("\"" "
\e,TF
\e(B")
130 ("z" "
\e,T<
\e(B" consonant) ("Z" "(")
131 ("x" "
\e,T;
\e(B" consonant) ("X" ")")
132 ("c" "
\e,Ta
\e(B") ("C" "
\e,T)
\e(B" consonant)
133 ("v" "
\e,TM
\e(B" consonant) ("V" "
\e,TN
\e(B" consonant)
134 ("b" "
\e,TT
\e(B" vowel) ("B" "
\e,TZ
\e(B" vowel)
135 ("n" "
\e,TW
\e(B" vowel) ("N" "
\e,Tl
\e(B" tone)
136 ("m" "
\e,T7
\e(B" consonant) ("M" "
\e,Tn
\e(B" vowel)
137 ("," "
\e,TA
\e(B" consonant) ("<" "
\e,T2
\e(B" consonant)
138 ("." "
\e,Tc
\e(B") (">" "
\e,TL
\e(B" consonant)
139 ("/" "
\e,T=
\e(B" consonant) ("?" "?")))
141 (define-its-state-machine-append its-thai-kesmanee-map)
145 ;;; its/thai.el ends here