X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fegg.git;a=blobdiff_plain;f=its%2Fthai.el;fp=its%2Fthai.el;h=10555ee8ffd9a1ea8935e7b3a1fa549829ef0639;hp=3b41d18970fa361d5c7c4ae23a6ffb3a8744b794;hb=63a92a03c38d9ee2fdb44d5da8ffa253e3ed925c;hpb=a11e28d9cdf108d34265730dcbfd406ae85971b9 diff --git a/its/thai.el b/its/thai.el index 3b41d18..10555ee 100644 --- a/its/thai.el +++ b/its/thai.el @@ -1,6 +1,6 @@ ;;; its/thai.el --- Inputting Thai characters in Egg Input Method Architecture -;; Copyright (C) 1998 Mule Project, +;; Copyright (C) 1997, 1998 Mule Project, ;; Powered by Electrotechnical Laboratory, JAPAN. ;; Project Leader: Satoru Tomura @@ -45,52 +45,38 @@ list)))) `(let (consonant vowel tone) ,@list - (its-define-thai-composit consonant vowel tone)))) + (its-thai-composit consonant vowel tone)))) - (defun its-define-thai-composit (consonant vowel tone) - (let (pair state) + (defun its-thai-composit (consonant vowel tone) + (let (keyseq output) (while consonant - (setq pair (car consonant) + (setq keyseq (car (car consonant)) + output (cdr (car consonant)) consonant (cdr consonant)) - (setq state (its-goto-state (car pair))) - (its-make-next-state state -1 (aref (cdr pair) 0) (cdr pair)) - (its-define-thai-add-vowel state (car pair) (cdr pair) vowel tone) - (its-define-thai-add-tone state (car pair) (cdr pair) tone) - (its-defrule-otherwise state (cdr pair))))) - - (defun its-define-thai-add-vowel (state keyseq output vowel tone) - (let (next-state next-key next-keyseq next-output composed-output) + (its-thai-add-vowel keyseq output vowel tone) + (its-thai-add-tone keyseq output tone)))) + + (defun its-thai-add-vowel (keyseq output vowel tone) + (let (next-keyseq next-output) (while vowel - (setq next-key (car (car vowel)) - next-keyseq (concat keyseq next-key) + (setq next-keyseq (concat keyseq (car (car vowel))) next-output (concat output (cdr (car vowel))) - composed-output (compose-string next-output) vowel (cdr vowel)) - (setq next-state (its-make-next-state state - (aref next-key 0) - next-keyseq - composed-output)) - (its-make-next-state next-state -1 next-keyseq composed-output) - (its-define-thai-add-tone next-state next-keyseq next-output tone) - (its-defrule-otherwise next-state composed-output)))) - - (defun its-define-thai-add-tone (state keyseq output tone) - (let (next-state next-key next-keyseq next-output composed-output) + (its-defrule next-keyseq (compose-string next-output)) + (its-thai-add-tone next-keyseq next-output tone)))) + + (defun its-thai-add-tone (keyseq output tone) + (let (next-keyseq next-output) (while tone - (setq next-key (car (car tone)) - next-keyseq (concat keyseq next-key) + (setq next-keyseq (concat keyseq (car (car tone))) next-output (concat output (cdr (car tone))) - composed-output (compose-string next-output) - tone (cdr tone)) - (setq next-state (its-make-next-state state - (aref next-key 0) - next-keyseq - composed-output)))))) + tone (cdr tone)) + (its-defrule next-keyseq (compose-string next-output)))))) ;; Thai Kesmanee keyboard support. (define-its-state-machine its-thai-kesmanee-map - "kesmanee" ",T!!(B" 'Thai + "kesmanee" ",T!!(B" Thai "Map for Thai Kesmanee input method with TIS620 keyboard. (Thai)" (define-its-thai-keymap