annotate leim/quail/lrt.el @ 22890:5044c732dbde

(Fdocumentation): Specify UNIBYTE = 0 when calling get_doc_string for a compiled function.
author Richard M. Stallman <rms@gnu.org>
date Sun, 02 Aug 1998 02:44:04 +0000
parents f245110aa619
children cd1cb9bf30e1
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
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
39 `(("k" . ?(1!(B)
18673
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)
21384
f245110aa619 (lrt-composing-pattern-double-c): Change
Andreas Schwab <schwab@suse.de>
parents: 19722
diff changeset
69 ("lh" . "0(1K\(B1")
18673
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))
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
107 ("ua" "(1[GP(B" (0 ?(1[(B ?(1G(B ?(1P(B) (0 ?(1Q(B ?(1G(B))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
108 ("uaa" "(1[G(B" (0 ?(1[(B ?(1G(B) (0 ?(1G(B))
18673
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))
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
111 ("ea" "(1`VM(B" (?(1`(B 0 ?(1V(B ?(1M(B))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
112 ("eaa" "(1`WM(B" (?(1`(B 0 ?(1W(B ?(1M(B))
18673
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))
19373
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
116 ("aM" "(1S(B" (0 ?(1S(B))))
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)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
163 (chars (string-to-list
21384
f245110aa619 (lrt-composing-pattern-double-c): Change
Andreas Schwab <schwab@suse.de>
parents: 19722
diff changeset
164 (if (= (length str) 1)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
165 (decompose-string str)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
166 str)))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
167 place)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
168 ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
169 (while tail
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
170 ;; At first, make a copy.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
171 (setcar tail (copy-sequence (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
172 ;; Then, do embedding.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
173 (setq place (memq 0 (car tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
174 (setcar place (car chars))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
175 (setcdr place (cons (nth 1 chars) (cdr place)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
176 (if semi-vowel
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
177 ;; Embed SEMI-VOWEL in between CHARS.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
178 (setcdr place (cons semi-vowel (cdr place))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 (setq tail (cdr tail)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180 patterns))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
181
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
182 ;; Return a string made of characters in CHAR-LIST while composing
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 ;; such characters as vowel-upper, vowel-lower, semi-vowel(lower),
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184 ;; and tone-mark with the preceding base character.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 (defun lrt-compose-string (char-list)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 ;; Make a copy because the following work alters it.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 (setq char-list (copy-sequence char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 (let ((i -1)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
189 (l char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 (while l
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 (if (memq (get-char-code-property (car l) 'phonetic-type)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192 '(vowel-upper vowel-lower semivowel-lower tone))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 (let (composed-char)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
194 (if (< i 0)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
195 ;; No preceding base character.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
196 (error "Invalid CHAR-LIST: %s" char-list))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
197 (setq composed-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
198 (string-to-char (compose-chars (nth i char-list) (car l))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
199 (setcar (nthcdr i char-list) composed-char)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
200 (setq l (cdr l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 (setcdr (nthcdr i char-list) l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
202 (setq l (cdr l))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
203 (setq i (1+ i))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
204 (concat (apply 'vector char-list))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
205
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
206 (defun lrt-compose-c-s-v (consonant semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
207 (let ((pattern-list
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
208 (if (integerp consonant)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209 (lrt-composing-pattern-single-c
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
210 consonant semi-vowel vowel-pattern)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
211 (lrt-composing-pattern-double-c
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
212 consonant semi-vowel vowel-pattern))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
213 (cons (vector (lrt-compose-string (car pattern-list)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
214 (cons t pattern-list))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
215
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
216 )
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
217
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
218 (defun lrt-handle-maa-sakod ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
219 (interactive)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
220 (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
221 (not quail-current-data))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
222 (quail-self-insert-command)
18833
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
223 (if (not (car quail-current-data))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
224 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
225 (setq quail-current-data nil)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
226 (setq unread-command-events
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
227 (cons last-command-event unread-command-events))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
228 (quail-terminate-translation))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
229 (if (not (integerp last-command-event))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
230 (error "Bogus calling sequence"))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
231 (let* ((maa-sakod (cdr (assq last-command-event lrt-maa-sakod-table)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
232 (maa-sakod-pattern (append
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
233 (or (cdr (assq maa-sakod
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
234 (nthcdr 3 quail-current-data)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
235 (nth 2 quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
236 (nth 1 quail-current-data))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
237 (list maa-sakod))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
238 (quail-delete-region)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
239 (setq quail-current-str (lrt-compose-string maa-sakod-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
240 (insert quail-current-str)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
241 (quail-show-translations)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242 (setq quail-current-data (list nil maa-sakod-pattern))))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
244 (defun lrt-handle-tone-mark ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
245 (interactive)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
246 (if (= (length quail-current-key) 0)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
247 (quail-self-insert-command)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
248 (if (not quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
249 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
250 (setq unread-command-events
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251 (cons last-command-event unread-command-events))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 (quail-terminate-translation))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
253 (if (not (integerp last-command-event))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
254 (error "Bogus calling sequence"))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 (let* ((tone-mark (cdr (assoc (char-to-string last-command-event)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 lrt-tone-mark-table)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
257 (tone-mark-pattern
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
258 (if (car quail-current-data)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
259 (copy-sequence (nth 1 quail-current-data))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
260 ;; No need of copy because lrt-handle-maa-sakod should
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
261 ;; have already done it.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
262 (nth 1 quail-current-data)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
263 (tail tone-mark-pattern)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
264 (double-consonant-keys lrt-double-consonant-table)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
265 (double-consonant-flag nil)
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
266 place)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
267
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
268 ;; Set DOUBLE-CONSONANT-FLAG to t if a user entered a double
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
269 ;; consonant.
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
270 (while (and double-consonant-keys (not double-consonant-flag))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
271 (setq double-consonant-flag
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
272 (eq (string-match (car (car double-consonant-keys))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
273 quail-current-key)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
274 0)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
275 double-consonant-keys (cdr double-consonant-keys)))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
276
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
277 ;; Find a place to embed TONE-MARK. It should be after a
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
278 ;; single or double consonant and following upper or lower vowels.
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
279 (while (and tail (not place))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
280 (if (and
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
281 (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
282 'consonant)
48e05cca9d7b (lrt-vowel-table): Change "ow" -> "ao", "am" -> "arm".
Kenichi Handa <handa@m17n.org>
parents: 18673
diff changeset
283 ;; Skip `(1K(B' if it is the first letter of double consonant.
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
284 (or (not double-consonant-flag)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
285 (/= (car tail) ?(1K(B)))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
286 (progn
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
287 (setq place tail)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
288 (setq tail (cdr tail))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289 (while (and tail
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 (memq (get-char-code-property (car tail)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 'phonetic-type)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 '(vowel-upper vowel-lower semivowel-lower)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293 (setq place tail tail (cdr tail))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 (setq tail (cdr tail))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 ;; Embed TONE-MARK.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 (setcdr place (cons tone-mark (cdr place)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 (quail-delete-region)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 (insert (lrt-compose-string tone-mark-pattern))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
299 (setq quail-current-data nil)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300 (quail-terminate-translation)))))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
301
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
302 (defmacro lrt-generate-quail-map ()
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
303 `(quail-install-map
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
304 ',(let ((map (list nil))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
305 (semi-vowel-key (car lrt-semi-vowel-sign-lo))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
306 (semi-vowel-char (cdr lrt-semi-vowel-sign-lo))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
307 l1 e1 l2 e2 pattern key)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
308 ;; Single consonants.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 (setq l1 lrt-single-consonant-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 (setq e1 (car l1))
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
312 (quail-defrule-internal (car e1) (vector (cdr e1)) map)
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 (concat (car e1) semi-vowel-key)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
315 (if (stringp (cdr e1))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
316 (compose-string (format "%s%c" (cdr e1) semi-vowel-char))
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
317 (compose-string (format "%c%c" (cdr e1) semi-vowel-char)))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318 map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
319 (setq l2 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
320 (while l2
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
321 (setq e2 (car l2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
322 (setq key (concat (car e1) (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
328 (setq key (concat (car e1) semi-vowel-key (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
329 pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
330 (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 (setq l2 (cdr l2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336 (setq l1 (cdr l1)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 ;; Double consonants.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
339 (setq l1 lrt-double-consonant-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
340 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
341 (setq e1 (car l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
342 (quail-defrule-internal (car e1) (vector (cdr e1)) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
343 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
344 (concat (car e1) semi-vowel-key)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
345 (vector (concat (compose-string
21384
f245110aa619 (lrt-composing-pattern-double-c): Change
Andreas Schwab <schwab@suse.de>
parents: 19722
diff changeset
346 (format "%c%c" (aref (cdr e1) 0) semi-vowel-char))
f245110aa619 (lrt-composing-pattern-double-c): Change
Andreas Schwab <schwab@suse.de>
parents: 19722
diff changeset
347 (substring (cdr e1) 1)))
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
348 map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
349 (setq l2 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
350 (while l2
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
351 (setq e2 (car l2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
352 (setq key (concat (car e1) (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
353 pattern (lrt-compose-c-s-v (cdr e1) nil (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
354 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
355 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
356 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
357 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
358 (setq key (concat (car e1) semi-vowel-key (car e2))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
359 pattern (lrt-compose-c-s-v (cdr e1) semi-vowel-char
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 (nthcdr 2 e2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
361 (quail-defrule-internal key pattern map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 (quail-defrule-internal
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
363 (concat key " ")
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
364 (vector (concat (aref (car pattern) 0) " ")) map)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
365 (setq l2 (cdr l2)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366 (setq l1 (cdr l1)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
367
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
368 ;; Vowels.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
369 (setq l1 lrt-vowel-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
370 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
371 (setq e1 (car l1) l1 (cdr l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
372 (quail-defrule-internal (car e1) (vector (nth 1 e1)) map))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
373
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
374 ;; Tone-marks.
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
375 (setq l1 lrt-tone-mark-table)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
376 (while l1
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377 (setq e1 (car l1) l1 (cdr l1))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 (quail-defrule-internal (car e1) (cdr e1) map))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
380 map)))
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
381
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
382 (quail-define-package
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
383 "lao-lrt" "Lao" "(1E(BR" t
19373
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
384 "Lao input method using LRT (Lao Roman Transcription).
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
385 `\\' (backslash) + number-key => (1p(B,(1q(B,(1r(B,... LAO DIGIT ZERO, ONE, TWO, ...
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
386 `\\' (backslash) + `\\' => (1f(B LAO KO LA (REPETITION)
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
387 `\\' (backslash) + `$' => (1O(B LAO ELLIPSIS
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
388 "
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
389 '(("k" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
390 ("g" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
391 ("y" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
392 ("d" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
393 ("n" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
394 ("b" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
395 ("m" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
396 ("v" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
397 ("w" . lrt-handle-maa-sakod)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
398 ("'" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
399 ("\"" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
400 ("^" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
401 ("+" . lrt-handle-tone-mark)
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
402 ("~" . lrt-handle-tone-mark))
19722
dd39cae4cf0f For each package, pass t for the SIMPLE
Kenichi Handa <handa@m17n.org>
parents: 19373
diff changeset
403 'forget-last-selection 'deterministic 'kbd-translate 'show-layout
dd39cae4cf0f For each package, pass t for the SIMPLE
Kenichi Handa <handa@m17n.org>
parents: 19373
diff changeset
404 nil nil nil nil nil t)
18673
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
405
751941736224 Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
406 (lrt-generate-quail-map)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
407
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
408 ;; Additional key definitions for Lao digits.
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
409
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
410 (quail-defrule "\\0" ?(1p(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
411 (quail-defrule "\\1" ?(1q(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
412 (quail-defrule "\\2" ?(1r(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
413 (quail-defrule "\\3" ?(1s(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
414 (quail-defrule "\\4" ?(1t(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
415 (quail-defrule "\\5" ?(1u(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
416 (quail-defrule "\\6" ?(1v(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
417 (quail-defrule "\\7" ?(1w(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
418 (quail-defrule "\\8" ?(1x(B)
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
419 (quail-defrule "\\9" ?(1y(B)
19373
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
420 (quail-defrule "\\\\" ?(1f(B)
314fa41f0155 (lrt-vowel-table): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents: 19260
diff changeset
421 (quail-defrule "\\$" ?(1O(B)
19260
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
422
2d94069b1e81 Change title string of input method "lao-lrt".
Kenichi Handa <handa@m17n.org>
parents: 18833
diff changeset
423 ;;; quail/lrt.el ends here