aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1997-08-10 04:04:35 +0000
committerKenichi Handa1997-08-10 04:04:35 +0000
commitf89752e93ea9f923fe2ed5805ab85cec94ddff72 (patch)
tree49c7a0750986495cc576fb5f040af5b02b42aedf
parenta8bb18505ab2cbc6a0f956c135accc67a661bba9 (diff)
downloademacs-f89752e93ea9f923fe2ed5805ab85cec94ddff72.tar.gz
emacs-f89752e93ea9f923fe2ed5805ab85cec94ddff72.zip
Change title string of input method "lao-lrt".
(lrt-single-consonant-table): Several key sequence changed. (lrt-composing-pattern-double-c): Handle a consonant with semi-vowel-lower correctly. (lrt-handle-maa-sakod): Do not reset quail-current-key. (lrt-handle-tone-mark): Check the existence of double consonant correctly.
-rw-r--r--leim/quail/lrt.el67
1 files changed, 46 insertions, 21 deletions
diff --git a/leim/quail/lrt.el b/leim/quail/lrt.el
index 198fce0425d..ad59abe1baf 100644
--- a/leim/quail/lrt.el
+++ b/leim/quail/lrt.el
@@ -36,7 +36,7 @@
36;; Upper vowels and tone-marks are put on the letter. 36;; Upper vowels and tone-marks are put on the letter.
37;; Semi-vowel-sign-lo and lower vowels are put under the letter. 37;; Semi-vowel-sign-lo and lower vowels are put under the letter.
38(defconst lrt-single-consonant-table 38(defconst lrt-single-consonant-table
39 '(("k" . ?(1!(B) 39 `(("k" . ?(1!(B)
40 ("kh" . ?(1"(B) 40 ("kh" . ?(1"(B)
41 ("qh" . ?(1$(B) 41 ("qh" . ?(1$(B)
42 ("ng" . ?(1'(B) 42 ("ng" . ?(1'(B)
@@ -66,7 +66,7 @@
66 ("h" . ?(1N(B) 66 ("h" . ?(1N(B)
67 ("nh" . ?(1|(B) 67 ("nh" . ?(1|(B)
68 ("mh" . ?(1}(B) 68 ("mh" . ?(1}(B)
69 ("lh" . ?0(1K\1(B) 69 ("lh" . "0(1K\1(B")
70 )) 70 ))
71 71
72;; Semi-vowel-sign-lo is put under the first letter. 72;; Semi-vowel-sign-lo is put under the first letter.
@@ -104,16 +104,16 @@
104 ("or" "(1m(B" (0 ?(1m(B) (0 ?(1M(B)) 104 ("or" "(1m(B" (0 ?(1m(B) (0 ?(1M(B))
105 ("er" "(1`(B (1T(B" (?(1`(B 0 ?(1T(B)) 105 ("er" "(1`(B (1T(B" (?(1`(B 0 ?(1T(B))
106 ("ir" "(1`(B (1U(B" (?(1`(B 0 ?(1U(B)) 106 ("ir" "(1`(B (1U(B" (?(1`(B 0 ?(1U(B))
107 ("oua" "(1[GP(B" (0 ?(1[(B ?(1G(B ?(1P(B) (0 ?(1Q(B ?(1G(B)) 107 ("ua" "(1[GP(B" (0 ?(1[(B ?(1G(B ?(1P(B) (0 ?(1Q(B ?(1G(B))
108 ("ua" "(1[G(B" (0 ?(1[(B ?(1G(B) (0 ?(1G(B)) 108 ("uaa" "(1[G(B" (0 ?(1[(B ?(1G(B) (0 ?(1G(B))
109 ("ie" "(1`Q]P(B" (?(1`(B 0 ?(1Q(B ?(1](B ?(1P(B) (0 ?(1Q(B ?(1](B)) 109 ("ie" "(1`Q]P(B" (?(1`(B 0 ?(1Q(B ?(1](B ?(1P(B) (0 ?(1Q(B ?(1](B))
110 ("ia" "(1`Q](B" (?(1`(B 0 ?(1Q(B ?(1](B) (0 ?(1](B)) 110 ("ia" "(1`Q](B" (?(1`(B 0 ?(1Q(B ?(1](B) (0 ?(1](B))
111 ("eua" "(1`VM(B" (?(1`(B 0 ?(1V(B ?(1M(B)) 111 ("ea" "(1`VM(B" (?(1`(B 0 ?(1V(B ?(1M(B))
112 ("ea" "(1`WM(B" (?(1`(B 0 ?(1W(B ?(1M(B)) 112 ("eaa" "(1`WM(B" (?(1`(B 0 ?(1W(B ?(1M(B))
113 ("ai" "(1d(B" (?(1d(B 0)) 113 ("ai" "(1d(B" (?(1d(B 0))
114 ("ei" "(1c(B" (?(1c(B 0)) 114 ("ei" "(1c(B" (?(1c(B 0))
115 ("ao" "(1`[R(B" (?(1`(B 0 ?(1[(B ?(1R(B)) 115 ("ao" "(1`[R(B" (?(1`(B 0 ?(1[(B ?(1R(B))
116 ("arm" "(1S(B" (?(1S(B 0)))) 116 ("aM" "(1S(B" (?(1S(B 0))))
117 117
118;; Maa-sakod is put at the tail. 118;; Maa-sakod is put at the tail.
119(defconst lrt-maa-sakod-table 119(defconst lrt-maa-sakod-table
@@ -160,7 +160,10 @@
160(defun lrt-composing-pattern-double-c (str semi-vowel vowel-pattern) 160(defun lrt-composing-pattern-double-c (str semi-vowel vowel-pattern)
161 (let* ((patterns (copy-sequence vowel-pattern)) 161 (let* ((patterns (copy-sequence vowel-pattern))
162 (tail patterns) 162 (tail patterns)
163 (chars (string-to-list str)) 163 (chars (string-to-list
164 (if (= (chars-in-string str) 1)
165 (decompose-string str)
166 str)))
164 place) 167 place)
165 ;; Embed C and SEMI-VOWEL (if any) at the place of 0. 168 ;; Embed C and SEMI-VOWEL (if any) at the place of 0.
166 (while tail 169 (while tail
@@ -235,7 +238,6 @@
235 (quail-delete-region) 238 (quail-delete-region)
236 (setq quail-current-str (lrt-compose-string maa-sakod-pattern)) 239 (setq quail-current-str (lrt-compose-string maa-sakod-pattern))
237 (insert quail-current-str) 240 (insert quail-current-str)
238 (setq quail-current-key " ")
239 (quail-show-translations) 241 (quail-show-translations)
240 (setq quail-current-data (list nil maa-sakod-pattern)))))) 242 (setq quail-current-data (list nil maa-sakod-pattern))))))
241 243
@@ -259,22 +261,28 @@
259 ;; have already done it. 261 ;; have already done it.
260 (nth 1 quail-current-data))) 262 (nth 1 quail-current-data)))
261 (tail tone-mark-pattern) 263 (tail tone-mark-pattern)
262 (double-consonant-tail '(?(1'(B ?(1](B ?(1G(B ?(1E(B ?(1-(B ?(19(B ?(1A(B)) 264 (double-consonant-keys lrt-double-consonant-table)
265 (double-consonant-flag nil)
263 place) 266 place)
267
268 ;; Set DOUBLE-CONSONANT-FLAG to t if a user entered a double
269 ;; consonant.
270 (while (and double-consonant-keys (not double-consonant-flag))
271 (setq double-consonant-flag
272 (eq (string-match (car (car double-consonant-keys))
273 quail-current-key)
274 0)
275 double-consonant-keys (cdr double-consonant-keys)))
276
264 ;; Find a place to embed TONE-MARK. It should be after a 277 ;; Find a place to embed TONE-MARK. It should be after a
265 ;; single or double consonant and following vowels. 278 ;; single or double consonant and following upper or lower vowels.
266 (while (and tail (not place)) 279 (while (and tail (not place))
267 (if (and 280 (if (and
268 (eq (get-char-code-property (car tail) 'phonetic-type) 281 (eq (get-char-code-property (car tail) 'phonetic-type)
269 'consonant) 282 'consonant)
270 ;; Skip `(1K(B' if it is the first letter of double consonant. 283 ;; Skip `(1K(B' if it is the first letter of double consonant.
271 (or (/= (car tail) ?(1K(B) 284 (or (not double-consonant-flag)
272 (not (cdr tail)) 285 (/= (car tail) ?(1K(B)))
273 (not
274 (if (= (car (cdr tail)) ?(1\(B)
275 (and (cdr (cdr tail))
276 (memq (car (cdr (cdr tail))) double-consonant-tail))
277 (memq (car (cdr tail)) double-consonant-tail)))))
278 (progn 286 (progn
279 (setq place tail) 287 (setq place tail)
280 (setq tail (cdr tail)) 288 (setq tail (cdr tail))
@@ -301,10 +309,12 @@
301 (setq l1 lrt-single-consonant-table) 309 (setq l1 lrt-single-consonant-table)
302 (while l1 310 (while l1
303 (setq e1 (car l1)) 311 (setq e1 (car l1))
304 (quail-defrule-internal (car e1) (cdr e1) map) 312 (quail-defrule-internal (car e1) (vector (cdr e1)) map)
305 (quail-defrule-internal 313 (quail-defrule-internal
306 (concat (car e1) semi-vowel-key) 314 (concat (car e1) semi-vowel-key)
307 (compose-string (format "%c%c" (cdr e1) semi-vowel-char)) 315 (if (stringp (cdr e1))
316 (compose-string (format "%s%c" (cdr e1) semi-vowel-char))
317 (compose-string (format "%c%c" (cdr e1) semi-vowel-char)))
308 map) 318 map)
309 (setq l2 lrt-vowel-table) 319 (setq l2 lrt-vowel-table)
310 (while l2 320 (while l2
@@ -370,7 +380,7 @@
370 map))) 380 map)))
371 381
372(quail-define-package 382(quail-define-package
373 "lao-lrt" "Lao" "(1"(BR" t 383 "lao-lrt" "Lao" "(1E(BR" t
374 "Lao input method using LRT (Lao Roman Transcription)" 384 "Lao input method using LRT (Lao Roman Transcription)"
375 '(("k" . lrt-handle-maa-sakod) 385 '(("k" . lrt-handle-maa-sakod)
376 ("g" . lrt-handle-maa-sakod) 386 ("g" . lrt-handle-maa-sakod)
@@ -389,3 +399,18 @@
389 'forget-last-selection 'deterministic 'kbd-translate 'show-layout) 399 'forget-last-selection 'deterministic 'kbd-translate 'show-layout)
390 400
391(lrt-generate-quail-map) 401(lrt-generate-quail-map)
402
403;; Additional key definitions for Lao digits.
404
405(quail-defrule "\\0" ?(1p(B)
406(quail-defrule "\\1" ?(1q(B)
407(quail-defrule "\\2" ?(1r(B)
408(quail-defrule "\\3" ?(1s(B)
409(quail-defrule "\\4" ?(1t(B)
410(quail-defrule "\\5" ?(1u(B)
411(quail-defrule "\\6" ?(1v(B)
412(quail-defrule "\\7" ?(1w(B)
413(quail-defrule "\\8" ?(1x(B)
414(quail-defrule "\\9" ?(1y(B)
415
416;;; quail/lrt.el ends here