annotate leim/quail/lrt.el @ 18839:1405083241e8

new version
author Michael Kifer <kifer@cs.stonybrook.edu>
date Thu, 17 Jul 1997 19:37:07 +0000
parents 48e05cca9d7b
children 2d94069b1e81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
1 ;;; quail/lrt.el --- Quail package for inputting Lao characters by LRT method
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
2
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
3 ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
4 ;; Licensed to the Free Software Foundation.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
5
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
6 ;; Keywords: multilingual, input method, Lao, LRT.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
7
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13 ;; any later version.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
14
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
24
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
25 ;;; Code:
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
26
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27 (require 'quail)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
28 (require 'lao-util)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
29
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30 ;; LRT (Lao Roman Transcription) input method accepts the following
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31 ;; key sequence:
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
32 ;; consonant [+ semi-vowel-sign-lo ] + vowel [+ maa-sakod ] [+ tone-mark ]
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34 (eval-and-compile
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 ;; Upper vowels and tone-marks are put on the letter.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 ;; Semi-vowel-sign-lo and lower vowels are put under the letter.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 (defconst lrt-single-consonant-table
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39 '(("k" . ?(1!(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 ("kh" . ?(1"(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41 ("qh" . ?(1$(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 ("ng" . ?(1'(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 ("j" . ?(1((B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 ("s" . ?(1J(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 ("x" . ?(1*(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46 ("y" . ?(1-(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 ("d" . ?(14(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 ("t" . ?(15(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 ("th" . ?(16(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 ("dh" . ?(17(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 ("n" . ?(19(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 ("b" . ?(1:(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 ("p" . ?(1;(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 ("hp" . ?(1<(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55 ("fh" . ?(1=(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 ("ph" . ?(1>(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 ("f" . ?(1?(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 ("m" . ?(1A(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 ("gn" . ?(1B(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 ("l" . ?(1E(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 ("r" . ?(1C(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 ("v" . ?(1G(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 ("w" . ?(1G(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 ("hh" . ?(1K(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 ("O" . ?(1M(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 ("h" . ?(1N(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 ("nh" . ?(1|(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 ("mh" . ?(1}(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 ("lh" . ?0(1K\1(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 ))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 ;; Semi-vowel-sign-lo is put under the first letter.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73 ;; Lower vowels are put under the last letter.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
74 ;; Upper vowels and tone-marks are put on the last letter.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
75 (defconst lrt-double-consonant-table
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 '(("ngh" . "(1K'(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 ("yh" . "(1K](B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 ("wh" . "(1KG(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 ("hl" . "(1KE(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 ("hy" . "(1K-(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 ("hn" . "(1K9(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 ("hm" . "(1KA(B")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 ))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 (defconst lrt-semi-vowel-sign-lo
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
86 '("r" . ?(1\(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
87
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
88 (defconst lrt-vowel-table
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
89 '(("a" "(1P(B" (0 ?(1P(B) (0 ?(1Q(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
90 ("ar" "(1R(B" (0 ?(1R(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
91 ("i" "(1T(B" (0 ?(1T(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
92 ("ii" "(1U(B" (0 ?(1U(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93 ("eu" "(1V(B" (0 ?(1V(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94 ("ur" "(1W(B" (0 ?(1W(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 ("u" "(1X(B" (0 ?(1X(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 ("uu" "(1Y(B" (0 ?(1Y(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97 ("e" "(1`(B (1P(B" (?(1`(B 0 ?(1P(B) (?(1`(B 0 ?(1Q(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 ("ee" "(1`(B" (?(1`(B 0))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 ("ae" "(1a(B (1P(B" (?(1a(B 0 ?(1P(B) (?(1a(B 0 ?(1Q(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 ("aa" "(1a(B" (?(1a(B 0))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 ("o" "(1b(B (1P(B" (?(1b(B 0 ?(1P(B) (0 ?(1[(B) (?(1-(B ?(1b(B 0 ?(1Q(B) (?(1G(B ?(1b(B 0 ?(1Q(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 ("oo" "(1b(B" (?(1b(B 0))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 ("oe" "(1`(B (1RP(B" (?(1`(B 0 ?(1R(B ?(1P(B) (0 ?(1Q(B ?(1M(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 ("or" "(1m(B" (0 ?(1m(B) (0 ?(1M(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 ("er" "(1`(B (1T(B" (?(1`(B 0 ?(1T(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 ("ir" "(1`(B (1U(B" (?(1`(B 0 ?(1U(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 ("oua" "(1[GP(B" (0 ?(1[(B ?(1G(B ?(1P(B) (0 ?(1Q(B ?(1G(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 ("ua" "(1[G(B" (0 ?(1[(B ?(1G(B) (0 ?(1G(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
109 ("ie" "(1`Q]P(B" (?(1`(B 0 ?(1Q(B ?(1](B ?(1P(B) (0 ?(1Q(B ?(1](B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
110 ("ia" "(1`Q](B" (?(1`(B 0 ?(1Q(B ?(1](B) (0 ?(1](B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
111 ("eua" "(1`VM(B" (?(1`(B 0 ?(1V(B ?(1M(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
112 ("ea" "(1`WM(B" (?(1`(B 0 ?(1W(B ?(1M(B))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
113 ("ai" "(1d(B" (?(1d(B 0))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
114 ("ei" "(1c(B" (?(1c(B 0))
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
115 ("ao" "(1`[R(B" (?(1`(B 0 ?(1[(B ?(1R(B))
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
116 ("arm" "(1S(B" (?(1S(B 0))))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
117
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118 ;; Maa-sakod is put at the tail.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119 (defconst lrt-maa-sakod-table
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120 '((?k . ?(1!(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 (?g . ?(1'(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 (?y . ?(1-(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 (?d . ?(14(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 (?n . ?(19(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 (?b . ?(1:(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 (?m . ?(1A(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 (?v . ?(1G(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 (?w . ?(1G(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 ))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 (defconst lrt-tone-mark-table
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132 '(("'" . ?(1h(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 ("\"" . ?(1i(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
134 ("^" . ?(1j(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
135 ("+" . ?(1k(B)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
136 ("~" . ?(1l(B)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
137
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
138 ;; Return list of composing patterns for normal (without maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
139 ;; key sequence and with-maa-sakod key sequence starting with single
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
140 ;; consonant C and optional SEMI-VOWEL.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
141 (defun lrt-composing-pattern-single-c (c semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
142 (let* ((patterns (copy-sequence vowel-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
143 (tail patterns)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
144 place)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
145 ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
146 (while tail
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
147 ;; At first, make a copy.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
148 (setcar tail (copy-sequence (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
149 ;; Then, do embedding.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
150 (setq place (memq 0 (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
151 (setcar place c)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
152 (if semi-vowel
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
153 (setcdr place (cons semi-vowel (cdr place))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
154 (setq tail (cdr tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
155 patterns))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
156
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
157 ;; Return list of composing patterns for normal (without maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
158 ;; key sequence and with-maa-sakod key sequence starting with double
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
159 ;; consonant STR and optional SEMI-VOWEL.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
160 (defun lrt-composing-pattern-double-c (str semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
161 (let* ((patterns (copy-sequence vowel-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
162 (tail patterns)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
163 (chars (string-to-list str))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
164 place)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
165 ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
166 (while tail
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
167 ;; At first, make a copy.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
168 (setcar tail (copy-sequence (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
169 ;; Then, do embedding.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
170 (setq place (memq 0 (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
171 (setcar place (car chars))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
172 (setcdr place (cons (nth 1 chars) (cdr place)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
173 (if semi-vowel
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
174 ;; Embed SEMI-VOWEL in between CHARS.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
175 (setcdr place (cons semi-vowel (cdr place))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
176 (setq tail (cdr tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
177 patterns))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
178
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 ;; Return a string made of characters in CHAR-LIST while composing
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180 ;; such characters as vowel-upper, vowel-lower, semi-vowel(lower),
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
181 ;; and tone-mark with the preceding base character.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
182 (defun lrt-compose-string (char-list)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 ;; Make a copy because the following work alters it.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184 (setq char-list (copy-sequence char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 (let ((i -1)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 (l char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 (while l
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 (if (memq (get-char-code-property (car l) 'phonetic-type)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
189 '(vowel-upper vowel-lower semivowel-lower tone))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 (let (composed-char)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 (if (< i 0)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192 ;; No preceding base character.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 (error "Invalid CHAR-LIST: %s" char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
194 (setq composed-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
195 (string-to-char (compose-chars (nth i char-list) (car l))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
196 (setcar (nthcdr i char-list) composed-char)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
197 (setq l (cdr l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
198 (setcdr (nthcdr i char-list) l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
199 (setq l (cdr l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
200 (setq i (1+ i))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 (concat (apply 'vector char-list))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
202
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
203 (defun lrt-compose-c-s-v (consonant semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
204 (let ((pattern-list
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
205 (if (integerp consonant)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
206 (lrt-composing-pattern-single-c
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
207 consonant semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
208 (lrt-composing-pattern-double-c
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209 consonant semi-vowel vowel-pattern))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
210 (cons (vector (lrt-compose-string (car pattern-list)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
211 (cons t pattern-list))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
212
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
213 )
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
214
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
215 (defun lrt-handle-maa-sakod ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
216 (interactive)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
217 (if (or (= (length quail-current-key) 0)
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
218 (not quail-current-data))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
219 (quail-self-insert-command)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
220 (if (not (car quail-current-data))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
221 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
222 (setq quail-current-data nil)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
223 (setq unread-command-events
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
224 (cons last-command-event unread-command-events))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
225 (quail-terminate-translation))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
226 (if (not (integerp last-command-event))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
227 (error "Bogus calling sequence"))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
228 (let* ((maa-sakod (cdr (assq last-command-event lrt-maa-sakod-table)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
229 (maa-sakod-pattern (append
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
230 (or (cdr (assq maa-sakod
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
231 (nthcdr 3 quail-current-data)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
232 (nth 2 quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
233 (nth 1 quail-current-data))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
234 (list maa-sakod))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
235 (quail-delete-region)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
236 (setq quail-current-str (lrt-compose-string maa-sakod-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
237 (insert quail-current-str)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
238 (setq quail-current-key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
239 (quail-show-translations)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
240 (setq quail-current-data (list nil maa-sakod-pattern))))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
241
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242 (defun lrt-handle-tone-mark ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243 (interactive)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
244 (if (= (length quail-current-key) 0)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
245 (quail-self-insert-command)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
246 (if (not quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
247 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
248 (setq unread-command-events
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
249 (cons last-command-event unread-command-events))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
250 (quail-terminate-translation))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251 (if (not (integerp last-command-event))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 (error "Bogus calling sequence"))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
253 (let* ((tone-mark (cdr (assoc (char-to-string last-command-event)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
254 lrt-tone-mark-table)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 (tone-mark-pattern
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 (if (car quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
257 (copy-sequence (nth 1 quail-current-data))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
258 ;; No need of copy because lrt-handle-maa-sakod should
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
259 ;; have already done it.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
260 (nth 1 quail-current-data)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
261 (tail tone-mark-pattern)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
262 (double-consonant-tail '(?(1'(B ?(1](B ?(1G(B ?(1E(B ?(1-(B ?(19(B ?(1A(B))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
263 place)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
264 ;; Find a place to embed TONE-MARK. It should be after a
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
265 ;; single or double consonant and following vowels.
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
266 (while (and tail (not place))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
267 (if (and
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
268 (eq (get-char-code-property (car tail) 'phonetic-type)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
269 'consonant)
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
270 ;; Skip `(1K(B' if it is the first letter of double consonant.
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
271 (or (/= (car tail) ?(1K(B)
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
272 (not (cdr tail))
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
273 (not
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
274 (if (= (car (cdr tail)) ?(1\(B)
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
275 (and (cdr (cdr tail))
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
276 (memq (car (cdr (cdr tail))) double-consonant-tail))
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
277 (memq (car (cdr tail)) double-consonant-tail)))))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
278 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
279 (setq place tail)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
280 (setq tail (cdr tail))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
281 (while (and tail
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
282 (memq (get-char-code-property (car tail)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
283 'phonetic-type)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
284 '(vowel-upper vowel-lower semivowel-lower)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
285 (setq place tail tail (cdr tail))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
286 (setq tail (cdr tail))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
287 ;; Embed TONE-MARK.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
288 (setcdr place (cons tone-mark (cdr place)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289 (quail-delete-region)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 (insert (lrt-compose-string tone-mark-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 (setq quail-current-data nil)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 (quail-terminate-translation)))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 (defmacro lrt-generate-quail-map ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 `(quail-install-map
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 ',(let ((map (list nil))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 (semi-vowel-key (car lrt-semi-vowel-sign-lo))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 (semi-vowel-char (cdr lrt-semi-vowel-sign-lo))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
299 l1 e1 l2 e2 pattern key)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300 ;; Single consonants.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
301 (setq l1 lrt-single-consonant-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
302 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
303 (setq e1 (car l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
304 (quail-defrule-internal (car e1) (cdr e1) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
305 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
306 (concat (car e1) semi-vowel-key)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
307 (compose-string (format "%c%c" (cdr e1) semi-vowel-char))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
308 map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 (setq l2 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 (while l2
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 (setq e2 (car l2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
312 (setq key (concat (car e1) (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
315 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
316 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
317 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318 (setq key (concat (car e1) semi-vowel-key (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
319 pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
320 (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
321 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
322 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 (setq l2 (cdr l2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326 (setq l1 (cdr l1)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
328 ;; Double consonants.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
329 (setq l1 lrt-double-consonant-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
330 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 (setq e1 (car l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 (quail-defrule-internal (car e1) (vector (cdr e1)) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 (concat (car e1) semi-vowel-key)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 (vector (concat (compose-string
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336 (format "%c%c" (sref (cdr e1) 0) semi-vowel-char))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337 (substring (cdr e1) (charset-bytes 'lao))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
339 (setq l2 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
340 (while l2
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
341 (setq e2 (car l2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
342 (setq key (concat (car e1) (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
343 pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
344 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
345 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
346 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
347 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
348 (setq key (concat (car e1) semi-vowel-key (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
349 pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
350 (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
351 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
352 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
353 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
354 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
355 (setq l2 (cdr l2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
356 (setq l1 (cdr l1)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
357
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
358 ;; Vowels.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
359 (setq l1 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
361 (setq e1 (car l1) l1 (cdr l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 (quail-defrule-internal (car e1) (vector (nth 1 e1)) map))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
363
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
364 ;; Tone-marks.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
365 (setq l1 lrt-tone-mark-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
367 (setq e1 (car l1) l1 (cdr l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
368 (quail-defrule-internal (car e1) (cdr e1) map))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
369
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
370 map)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
371
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
372 (quail-define-package
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
373 "lao-lrt" "Lao" "(1"(BR" t
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
374 "Lao input method using LRT (Lao Roman Transcription)"
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
375 '(("k" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
376 ("g" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377 ("y" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 ("d" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379 ("n" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
380 ("b" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
381 ("m" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
382 ("v" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
383 ("w" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
384 ("'" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
385 ("\"" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
386 ("^" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
387 ("+" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
388 ("~" . lrt-handle-tone-mark))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
389 'forget-last-selection 'deterministic 'kbd-translate 'show-layout)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
390
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
391 (lrt-generate-quail-map)