+1998-07-12 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * egg-mlh.el (mlh-space-bar-backward-henkan): Don't test against
+ egg-conversion-backend-alist.
+
+ * egg/wnn.el (wnn-fini-lang): Reneme from wnn-fini.
+ (wnn-fini): New implementation calling wnn-fini-lang.
+
+ (wnn-close): Call wnn-fini-lang.
+ (wnn-dictionary-save): Ditto.
+
+ * egg/canna.el (canna-fini): Delete LANG argument.
+ * egg/sj3.el (sj3-fini): Ditto.
+
+ * egg-cnv.el (egg-set-conversion-backend): Removed.
+
+ * egg/sj3.el (sj3-start-conversion): Signal error on non-supported
+ language.
+ * egg/canna.el (canna-start-conversion): Likewise.
+ * egg/wnn.el (wnn-start-conversion): Likewise.
+
+ * egg-cnv.el (egg-convert-region): Add handler for
+ lang-not-supported.
+
+ * egg/wnn.el (egg-activate-wnn): load wnnrpc here conditionally.
+ * egg/sj3.el: Likewise.
+ * egg/canna.el: Likewise.
+
+ * egg.el (egg-support-languages, egg-set-support-languages): Removed.
+ (egg-mode): Don't call egg-set-conversion-backend.
+ * egg/{canna.el, wnn.el, sj3.el}: Don't call egg-support-languages.
+
+ * egg-cnv.el (egg-set-current-backend): Removed.
+ (egg-initialize-backend, egg-start-conversion,
+ egg-start-reverse-conversion): Don't call egg-set-current-backend.
+ (egg-conversion-backend-null): Rename from *-other-languages.
+ (egg-conversion-backend-alist): Removed.
+ (egg-conversion-backend): Not buffer local.
+ (egg-finalize-backend-alist): Removed.
+
+1998-07-10 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * egg-cnv.el (egg-start-conversion-failure-hook): New Variable.
+ (egg-start-conversion-failure-fallback): New Function.
+ (egg-convert-region): Handle error and hook on failure.
+
+ * egg/sj3.el (sj3-open): Remove bogus setq-s of sj3-sys-dict-list,
+ sj3-user-dict-list.
+
+ * egg-mlh.el (mlh-space-bar-backward-henkan): Don't emit message
+ "converting...", as it may flush out error message.
+
+ * egg/sj3rpc.el ("egg-com", "egg/sj3"): Require on compilation.
+ (sj3rpc-open): Failure when version is different.
+
+1998-07-03 KATAYAMA Yoshio <kate@pfu.co.jp>
+
+ * its/erpin.el, its/hangul.el, its/hankata.el, its/hira.el,
+ its/jeonkak.el, its/kata.el, its/pinyin.el, its/quanjiao.el,
+ its/thai.el, its/zenkaku.el: Updated using new its-*.
+
+ * its.el (define-its-state-machine): Rewritten.
+ (define-its-compiled-map): Deleted.
+ (define-its-state-machine-append): Rewritten.
+ (its-defrule): Rewritten.
+ (its-defrule*): Rewritten.
+ (its-parent-states): New Variable.
+ (its-goto-state): Remove 2nd optional argument INITIAL-STATE.
+ (its-set-interim-terminal-state): New Function.
+ (its-make-next-state): Remove 2nd argument KEYSEQ.
+
+1998-07-01 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * egg-mlh.el (mlh-hira-to-kata): Removed. Doesn't work any more.
+ (mlh-katakana): Use japanese-katakana-region.
+
+ * egg-cnv.el (egg-conversion-map): Add again mapping for "/".
+
1998-06-27 KATAYAMA Yoshio <kate@pfu.co.jp>
* egg-cnv.el (egg-abort-conversion): Bug fix.
-pn;;; egg-cnv.el --- Conversion Backend in Egg Input Method Architecture
+;;; egg-cnv.el --- Conversion Backend in Egg Input Method Architecture
;; Copyright (C) 1997, 1998 Mule Project,
;; Powered by Electrotechnical Laboratory, JAPAN.
bunsetsu-info))
;;
-(defconst egg-conversion-backend-other-languages
- [ egg-init-other-languages
-
- egg-start-conversion-other-languages
- egg-get-bunsetsu-converted-other-languages
- egg-get-bunsetsu-source-other-languages
- egg-list-candidates-other-languages
- egg-get-number-of-candidates-other-languages
- egg-get-current-candidate-number-other-languages
- egg-get-all-candidates-other-languages
- egg-decide-candidate-other-languages
- egg-change-bunsetsu-length-other-languages
- egg-end-conversion-other-languages
+(defconst egg-conversion-backend-null
+ [ egg-init-null
+
+ egg-start-conversion-null
+ egg-get-bunsetsu-converted-null
+ egg-get-bunsetsu-source-null
+ egg-list-candidates-null
+ egg-get-number-of-candidates-null
+ egg-get-current-candidate-number-null
+ egg-get-all-candidates-null
+ egg-decide-candidate-null
+ egg-change-bunsetsu-length-null
+ egg-end-conversion-null
nil
- egg-fini-other-languages
+ egg-fini-null
])
-(defun egg-init-other-languages ()
- )
+(defun egg-init-null ()
+ )
-(defun egg-start-conversion-other-languages (yomi-string language)
- (setq egg-conversion-backend egg-conversion-backend-other-languages)
+(defun egg-start-conversion-null (yomi-string language)
(list yomi-string))
-(defun egg-get-bunsetsu-converted-other-languages (bunsetsu-info)
+(defun egg-get-bunsetsu-converted-null (bunsetsu-info)
bunsetsu-info)
-(defun egg-get-bunsetsu-source-other-languages (bunsetsu-info)
+(defun egg-get-bunsetsu-source-null (bunsetsu-info)
bunsetsu-info)
-(defun egg-list-candidates-other-languages (bunsetsu-info prev-bunsetsu-info)
+(defun egg-list-candidates-null (bunsetsu-info prev-bunsetsu-info)
1)
-(defun egg-get-number-of-candidates-other-languages (bunsetsu-info)
+(defun egg-get-number-of-candidates-null (bunsetsu-info)
1)
-(defun egg-get-current-candidate-number-other-languages (bunsetsu-info)
+(defun egg-get-current-candidate-number-null (bunsetsu-info)
0)
-(defun egg-get-all-candidates-other-languages (bunsetsu-info)
+(defun egg-get-all-candidates-null (bunsetsu-info)
(list bunsetsu-info))
-(defun egg-decide-candidate-other-languages (bunsetsu-info candidate-pos)
+(defun egg-decide-candidate-null (bunsetsu-info candidate-pos)
bunsetsu-info)
-(defun egg-change-bunsetsu-length-other-languages (b0 b1 b2 len)
+(defun egg-change-bunsetsu-length-null (b0 b1 b2 len)
(let ((s (concat b1 b2)))
(set-text-properties 0 (length s) nil s)
(if (= len (length s))
(list s)
(list (substring s 0 len) (substring s len)))))
-(defun egg-end-conversion-other-languages (bunsetsu-info-list abort)
+(defun egg-end-conversion-null (bunsetsu-info-list abort)
nil)
-(defun egg-fini-other-languages (language)
+(defun egg-fini-null (language)
nil)
-(defvar egg-conversion-backend-alist nil)
-(make-variable-buffer-local 'egg-conversion-backend-alist)
(defvar egg-conversion-backend nil)
-(make-variable-buffer-local 'egg-conversion-backend)
-
-(defvar egg-finalize-backend-alist nil)
-
-(defun egg-set-current-backend (language)
- (setq egg-conversion-backend
- (cdr (assq language egg-conversion-backend-alist)))
- (if (null egg-conversion-backend)
- (setq egg-conversion-backend egg-conversion-backend-other-languages)))
(defun egg-initialize-backend (language)
- (egg-set-current-backend language)
(funcall (aref egg-conversion-backend 0)))
(defun egg-start-conversion (yomi-string language)
- (egg-set-current-backend language)
(funcall (aref egg-conversion-backend 1) yomi-string language))
(defun egg-get-bunsetsu-converted (bunsetsu-info)
(funcall (aref egg-conversion-backend 2) bunsetsu-info))
(defun egg-end-conversion (bunsetsu-info-list abort)
(funcall (aref egg-conversion-backend 10) bunsetsu-info-list abort))
(defun egg-start-reverse-conversion (yomi-string language)
- (egg-set-current-backend language)
(if (aref egg-conversion-backend 11)
(funcall (aref egg-conversion-backend 11) yomi-string language)
(beep)))
(defun egg-finalize-backend ()
- (let ((alist egg-finalize-backend-alist))
- (while alist
- (funcall (car (car (car alist))) (cdr (car (car alist))))
- (setq alist (cdr alist)))))
-
-(defun egg-set-conversion-backend (backend langs &optional force)
- (let (pair)
- (if backend
- (setq egg-conversion-backend backend)
- (setq backend egg-conversion-backend))
- (while langs
- (setq pair (assoc (car langs) egg-conversion-backend-alist))
- (cond
- ((null pair)
- (setq egg-conversion-backend-alist
- (cons (cons (car langs) backend) egg-conversion-backend-alist)))
- (force
- (setcdr pair backend)))
- (setq pair (cons (aref backend (1- (length backend))) (car langs)))
- (if (null (assoc pair egg-finalize-backend-alist))
- (setq egg-finalize-backend-alist
- (cons (list pair) egg-finalize-backend-alist)))
- (setq langs (cdr langs)))))
+ (aref egg-conversion-backend 12))
\f
(defvar egg-conversion-open "|" "*\e$B%U%'%s%9$N;OE@$r<($9J8;zNs\e(B (1 \e$BJ8;z0J>e\e(B)")
(defvar egg-conversion-close "|" "*\e$B%U%'%s%9$N=*E@$r<($9J8;zNs\e(B (1 \e$BJ8;z0J>e\e(B)")
(assq t egg-conversion-face)))))
(if face (cdr face) egg-conversion-face)))
+(defvar egg-start-conversion-failure-hook
+ '(egg-start-conversion-failure-fallback)
+ "Hook which runs on failure of conversion.")
+
+;; SAIGO no shudan
+(defun egg-start-conversion-failure-fallback (language)
+ (setq egg-conversion-backend egg-conversion-backend-null))
+
;;
(defun egg-convert-region (start end)
(interactive "r")
(let ((source (buffer-substring start end))
(no-prop-source (buffer-substring-no-properties start end))
- bunsetsu-info-list len result i j s)
+ len result i j s)
(if (>= start end)
;; nothing to do
nil
(let ((inhibit-read-only t))
(its-define-select-keys egg-conversion-map)
(goto-char start)
- ;; XXX: Why make OPEN&CLOSE string every time when
- ;; this function is invoked? Any Reason?
- ;; For me it's matter of user costomization
- ;; of setting egg-conversion-open/egg-conversion-close
- ;; it can be string of properties at the beginning, isn't it?
(setq s (copy-sequence egg-conversion-open)
len (length s))
(set-text-properties 0 len
(while (< i len)
(setq egg-current-language (get-text-property i 'egg-lang source)
j (egg-next-single-property-change i 'egg-lang source len))
- (condition-case result
- (setq bunsetsu-info-list (egg-start-conversion
- (substring no-prop-source i j)
- egg-current-language))
- (error ; XXX: catching all error is BADBADBAD
- (setq bunsetsu-info-list (egg-start-conversion-other-languages
- (substring no-prop-source i j)
- egg-current-language))
- (message "egg %s backend: %s"
- egg-current-language (nth 1 result))))
- (egg-insert-bunsetsu-list bunsetsu-info-list
- (if (< j len) 'contine t))
+ (let (bunsetsu-info-list)
+ (while (null bunsetsu-info-list)
+ (condition-case err
+ (setq bunsetsu-info-list (egg-start-conversion
+ (substring no-prop-source i j)
+ egg-current-language))
+ ;; Don't catch programming error
+ (lang-not-supported
+ (message "Language not supported: %s" egg-current-language)
+ (ding)
+ (setq bunsetsu-info-list
+ (egg-start-conversion-null
+ (substring no-prop-source i j)
+ egg-current-language)))
+ (file-error
+ (message "Error on %s backend: %s"
+ egg-current-language (nth 1 err))
+ (ding)
+ (sit-for 1)
+ (run-hook-with-args-until-success
+ 'egg-start-conversion-failure-hook egg-current-language))))
+ (egg-insert-bunsetsu-list bunsetsu-info-list
+ (if (< j len) 'contine t)))
(setq i j))
(goto-char start)))))
(define-key map [right] 'egg-forward-bunsetsu)
(define-key map [left] 'egg-backward-bunsetsu)
(define-key map " " 'egg-next-candidate)
+ (define-key map "/" 'egg-exit-conversion)
map)
"Keymap for EGG Conversion mode.")
(let ((henkan-begin nil)
(inhibit-henkan t)
(its-disable-special-action t))
- (if (null (assq 'Japanese egg-conversion-backend-alist))
+ (if (null egg-conversion-backend)
(progn
(setq egg-mode-preference nil)
(activate-input-method (concat "japanese-egg-" mlh-default-backend)))
(if henkan-begin
(if (or inhibit-henkan (= henkan-begin (point)))
(egg-do-auto-fill)
- (progn
- (message "Converting...")
- (sit-for 0)
- (egg-convert-region henkan-begin (point))
- (message "") ))
+ (egg-convert-region henkan-begin (point)))
(setq this-command 'self-insert-command)
(call-interactively 'self-insert-command))))
(goto-char end-marker)
(forward-char -2)
(its-translate-region-internal beg (point))
- (insert (mlh-hira-to-kata
- (prog1
- (buffer-substring beg (point))
- (delete-region beg (point)))))
+ (japanese-katakana-region beg (point))
(delete-region (point) end-marker)
(if (null henkan-begin)
(setq henkan-begin beg)))
(if (null henkan-begin)
(setq henkan-begin beg)))
-(defun mlh-hira-to-kata (str)
- "Convert hiragana to katakana in STR."
- (let ((result (copy-sequence str))
- (i 0))
- (while (setq i (string-match "[\e$B$!\e(B-\e$B$s\e(B]" str i))
- (aset result (1+ i) ?\245)
- (setq i (+ i 3)))
- result))
-
(defun mlh-hangul ()
(forward-char -1)
(skip-chars-backward "a-zEO-RTW,.[]")
(if (null (string= (car arg) egg-last-method-name))
(progn
(funcall (nth 1 arg))
- (egg-set-conversion-backend nil (list its-current-language) t)
(setq egg-default-language its-current-language)))
(setq egg-last-method-name (car arg))
(use-local-map (if egg-mode-preference
"Generate modefull keymap for EGG mode."
(let ((map (make-sparse-keymap))
(i 33))
- (define-key map "\C-_" 'egg-jis-code-input)
+ ;; BAD BAD BAD it should be UNDO
+ ;; (define-key map "\C-_" 'egg-jis-code-input)
(while (< i 127)
(define-key map (vector i) 'egg-self-insert-char)
(setq i (1+ i)))
(require 'egg-mlh)
(require 'egg-cnv)
(require 'egg-com)
-(require 'custom)
+(require 'custom) ; Really?
(defgroup egg nil
"Tamagotchy --- EGG Versio 4.0")
-(defvar egg-support-languages nil)
-
-(defun egg-set-support-languages (langs)
- (while langs
- (if (null (member (car langs) egg-support-languages))
- (setq egg-support-languages (cons (car langs) egg-support-languages)))
- (setq langs (cdr langs))))
-
(add-hook 'kill-emacs-hook 'egg-kill-emacs-function)
(defun egg-kill-emacs-function ()
(egg-finalize-backend))
(require 'egg-edep)
-(defconst canna-support-languages '(Japanese))
-
(eval-when-compile
(defmacro CANNA-const (c)
(cond ((eq c 'FileNotExist) xxxxxxxxxxxxxx)
(defun canna-start-conversion (yomi lang)
"Convert YOMI string to kanji, and enter conversion mode.
Return the list of bunsetsu."
- (let ((env (canna-get-environment)))
- (cannarpc-begin-conversion env yomi)))
+ (if (eq lang 'Japanese)
+ (let ((env (canna-get-environment)))
+ (cannarpc-begin-conversion env yomi))
+ (signal 'lang-not-supported)))
(defun canna-end-conversion (bunsetsu-list abort)
(let* ((env (cannabunsetsu-get-env (car bunsetsu-list)))
(list bunsetsu1))))
;;;;;;;;;;;;;; MADAMADA
-(defun canna-fini (lang)
+(defun canna-fini ()
)
;;; setup
-
(require 'egg)
-(load "egg/cannarpc")
;;;###autoload
(defun egg-activate-canna (&rest arg)
"Activate CANNA backend of Tamagotchy."
- (egg-set-support-languages canna-support-languages)
- (egg-set-conversion-backend canna-conversion-backend
- canna-support-languages
- nil)
+ (setq egg-conversion-backend canna-conversion-backend)
+ (if (not (fboundp 'cannarpc-open))
+ (load-library "egg/canna"))
(apply 'egg-mode arg))
;;; egg/canna.el ends here.
(require 'egg-edep)
-(defconst sj3-support-languages '(Japanese))
-
(eval-when-compile
(defmacro SJ3-const (c)
(cond ((eq c 'FileNotExist) 35)
])
(defvar sj3-server-port 3000 "Port number of SJ3 server")
-(defvar sj3-stdy-size 0 "STDYSIZE of SJ3 server")
+(defvar sj3-stdy-size 0 "STDYSIZE of SJ3 server (will be set on connection)")
(defvar sj3-hostname "localhost"
"Hostname of SJ3 server")
(defun sj3-open (hostname)
"Establish the connection to SJ3 server. Return process object."
- (let* ((buf (generate-new-buffer " *SJ3*"))
- (proc (open-network-stream "SJ3" buf hostname sj3-server-port))
- result)
+ (let ((buf (generate-new-buffer " *SJ3*"))
+ proc result)
+ (condition-case err
+ (setq proc (open-network-stream "SJ3" buf hostname sj3-server-port))
+ (error
+ (kill-buffer buf)
+ (signal 'file-error (cdr err)))) ; Re-raise the signal with file-error
(process-kill-without-query proc)
(set-process-coding-system proc 'no-conversion 'no-conversion)
(set-marker-insertion-type (process-mark proc) t)
(erase-buffer)
(buffer-disable-undo)
(set-buffer-multibyte nil))
- ;; Initialize dictionaries
- (setq sj3-sys-dict-list nil)
- (setq sj3-user-dict-list nil)
(setq result (sj3rpc-open proc (system-name) (user-login-name)))
(if (< result 0)
(let ((msg (sj3rpc-get-error-message (- result))))
(delete-process proc)
(kill-buffer buf)
- (error "Can't open SJ3 session (%s): %s" hostname msg)))
- (setq result (sj3rpc-get-stdy-size proc))
- (if (< result 0)
- (let ((msg (sj3rpc-get-error-message (- result))))
- (delete-process proc)
- (kill-buffer buf)
- (error "Can't get SJ3 STDYSIZE: %s"msg)))
- (setq sj3-stdy-size result)
- proc))
-
-;; (defun sj3-open (hostname-list)
-;; "Establish the connection to SJ3 server. Return process object."
-;; (let* ((buf (generate-new-buffer " *SJ3*"))
-;; (msg-form "SJ3: connecting to sj3serv at %s...")
-;; hostname proc result msg)
-;; (save-excursion
-;; (set-buffer buf)
-;; (erase-buffer)
-;; (buffer-disable-undo)
-;; (setq enable-multibyte-characters nil))
-;; (cond
-;; ((null hostname-list)
-;; (setq hostname-list '("localhost")))
-;; ((null (listp hostname-list))
-;; (setq hostname-list (list hostname-list))))
-;; (while (and hostname-list (null proc))
-;; (setq hostname (car hostname-list)
-;; hostname-list (cdr hostname-list))
-;; (message msg-form hostname)
-;; (sit-for 0)
-;; (condition-case result
-;; (setq proc (open-network-stream "SJ3" buf hostname sj3-server-port))
-;; (error nil))
-;; (if proc
-;; (progn
-;; (process-kill-without-query proc)
-;; (set-process-coding-system proc 'no-conversion 'no-conversion)
-;; (set-marker-insertion-type (process-mark proc) t)
-;; ;; Initialize dictionaries
-;; (setq sj3-sys-dict-list nil)
-;; (setq sj3-user-dict-list nil)
-;; (setq result (sj3rpc-open proc (system-name) (user-login-name)))
-;; (if (< result 0)
-;; (progn
-;; (delete-process proc)
-;; (setq proc nil
-;; msg (format "Can't open SJ3 session (%s): %s"
-;; hostname msg)))
-;; (setq result (sj3rpc-get-stdy-size proc))
-;; (if (< result 0)
-;; (progn
-;; (delete-process proc)
-;; (setq proc nil
-;; msg (format "Can't get SJ3 STDYSIZE: %s"
-;; (sj3rpc-get-error-message (- result)))))
-;; (setq sj3-stdy-size result))))))
-;; (if proc
-;; (progn
-;; (setq sj3-open-message (format (concat msg-form "done") hostname))
-;; proc)
-;; (kill-buffer buf)
-;; (error "%s" (or msg "no sj3serv available")))))
+ (signal 'file-error
+ (list (format "Can't open SJ3 session (%s): %s" hostname msg))))
+ (setq result (sj3rpc-get-stdy-size proc))
+ (if (< result 0)
+ (let ((msg (sj3rpc-get-error-message (- result))))
+ (delete-process proc)
+ (kill-buffer buf)
+ (signal 'file-error
+ (list (format "Can't get SJ3 STDYSIZE: %s" msg)))))
+ (setq sj3-stdy-size result)
+ proc)))
;; <env> ::= [ <proc> <dictionary-list> ]
(defvar sj3-environment nil
(defun sj3-start-conversion (yomi &optional lang)
"Convert YOMI string to kanji, and enter conversion mode.
Return the list of bunsetsu."
- (let ((env (sj3-get-environment)))
- (sj3rpc-begin env yomi)))
+ (if (eq lang 'Japanese)
+ (let ((env (sj3-get-environment)))
+ (sj3rpc-begin env yomi))
+ (signal 'lang-not-supported)))
(defun sj3-end-conversion (bunsetsu-list abort)
(if abort
(list bunsetsu1 bunsetsu2)
(list bunsetsu1))))
-(defun sj3-fini (lang)
+(defun sj3-fini ()
(let ((proc (sj3env-get-proc sj3-environment))
(dict-list (sj3env-get-dictionary-list sj3-environment))
dict)
(setq sj3-environment nil))
;;; setup
-
(require 'egg)
-(load "egg/sj3rpc")
;;;###autoload
(defun egg-activate-sj3 (&rest arg)
"Activate SJ3 backend of Tamagotchy."
- (egg-set-support-languages sj3-support-languages)
- (egg-set-conversion-backend sj3-conversion-backend
- sj3-support-languages)
+ (setq egg-conversion-backend sj3-conversion-backend)
+ (if (not (fboundp 'sj3rpc-open))
+ (load-library "egg/sj3rpc"))
(apply 'egg-mode arg))
;;; egg/sj3.el ends here.
(eval-when-compile
(require 'egg-com)
-;; (load-library "egg/sj3")
+
+ ;; To get definition of sj3-make-bunsetsu and others
+ (load-library "egg/sj3")
(defmacro sj3-const (c)
(cond ((eq c 'OPEN) 1)
((eq c 'CLOSE) 2)
(t (error "No such constant")))))
;; XXX
-(defconst sj3rpc-error-message (vector ))
+(defconst sj3rpc-error-message
+ [
+ "Error #0 \e$B$G$9\e(B"
+ ])
(defun sj3rpc-get-error-message (errno)
(or (and (>= errno 0)
;; program name
(format "%d.emacs-egg" (emacs-pid)))
(comm-unpack (u) result)
- (if (= result -2)
- 0
- result)))
+ (if (= result -2) ; negated version number
+ 0 ; OK
+ -1))) ; Failure (different version)
(defun sj3rpc-close (proc)
(comm-call-with-proc proc (result)
(defun wnn-start-conversion (yomi &optional language dic-set reverse)
"Convert YOMI string to kanji, and enter conversion mode.
Return the list of bunsetsu."
- (let* ((server-info (wnn-server-get-info language))
- (env (wnn-get-environment server-info dic-set reverse))
- (result (wnnrpc-renbunsetsu-conversion env yomi
- (WNN-const BUN_SENTOU) "")))
- (wnnenv-set-daibunsetsu-info env (car result))
- (cdr result)))
+ (let ((server-info (wnn-server-get-info language)))
+ (if server-info
+ (let* ((env (wnn-get-environment server-info dic-set reverse))
+ (result (wnnrpc-renbunsetsu-conversion env yomi
+ (WNN-const BUN_SENTOU) "")))
+ (wnnenv-set-daibunsetsu-info env (car result))
+ (cdr result))
+ (signal 'lang-not-supported))))
(defun wnn-start-reverse-conversion (yomi &optional language dic-set)
(wnn-start-conversion yomi language dic-set t))
,@body)
(setq env-list (cdr env-list))))))
-(defun wnn-fini (lang &optional save-only)
+(defun wnn-fini ()
+ (let ((l wnn-support-languages))
+ (while l
+ (wnn-fini-lang (car l))
+ (setq l (cdr l)))))
+
+(defun wnn-fini-lang (lang &optional save-only)
(let* ((server-info (wnn-server-get-info lang))
(server-type (wnn-server-type server-info))
(l wnn-environments)
(or (listp lang)
(setq lang (list lang)))
(while lang
- (wnn-fini (car lang))
+ (wnn-fini-lang (car lang))
(setq lang (cdr lang))))
(defun wnn-dictionary-save (lang)
(or (listp lang)
(setq lang (list lang)))
(while lang
- (wnn-fini (car lang) t)
+ (wnn-fini-lang (car lang) t)
(setq lang (cdr lang))))
(defun wnn-read-active-lang ()
;;; setup
(require 'egg)
-(load "egg/wnnrpc")
;;;###autoload
(defun egg-activate-wnn (&rest arg)
"Activate Wnn backend of Tamagotchy."
- (egg-set-support-languages wnn-support-languages)
- (egg-set-conversion-backend wnn-conversion-backend
- wnn-support-languages)
+ (setq egg-conversion-backend wnn-conversion-backend)
+ (if (not (fboundp 'wnnrpc-open))
+ (load-library "egg/wnnrpc"))
(apply 'egg-mode arg))
;;; egg/wnn.el ends here.
map))
(defmacro define-its-state-machine (map name indicator lang doc &rest exprs)
- `(progn
- (eval-when (eval compile)
- (let ((its-current-map 'its-temporaly-map)
- (its-temporaly-map (its-new-map ,name ,indicator ,lang)))
- ,@exprs
- (setq ,map its-temporaly-map)))
- (define-its-compiled-map ,map ,doc)))
-
-(defmacro define-its-compiled-map (map doc)
+ (let ((its-current-map map))
+ (set map (its-new-map name indicator
+ (if (eq (car-safe lang) 'quote) (nth 1 lang) lang)))
+ (eval (cons 'progn exprs)))
`(defconst ,map ',(symbol-value map) ,doc))
(defmacro define-its-state-machine-append (map &rest exprs)
- (append
- `(let ((its-current-map 'its-temporaly-map)
- (its-temporaly-map ,map)))
- exprs
- (list `(setq ,map its-temporaly-map))))
+ `(let ((its-current-map ',map))
+ ,@exprs))
;;
;; Construct State Machine
\e$BLa$C$FF0$/$b$N$H$9$k!#JQ495,B'$O$b$C$H$b:G6a$K\e(B its-define-state-machine
\e$B$5$l$?JQ49I=$KEPO?$5$l$k!#\e(B
Return last state."
- (let ((state (its-goto-state (substring input 0 -1) nil t))
- (key (aref input (1- (length input)))))
- (if (and (its-get-next-state state key) (not enable-overwrite))
- (error "Duplicated definition (%s)" input)
- (its-make-next-state state key input output back))))
+ (let ((state (its-goto-state input (if enable-overwrite t 'dup-check))))
+ (its-set-output state output)
+ (its-set-kst state back)
+ state))
+
+(defun its-defrule* (input output &optional enable-overwrite)
+ (let* ((state (its-goto-state input (if enable-overwrite t 'dup-check))))
+ (its-set-kst state nil)
+ (its-set-interim-terminal-state state output)
+ state))
+
+(defvar its-parent-states)
-(defun its-goto-state (input &optional initial-state build-if-none)
+(defun its-goto-state (input &optional build-if-none)
(let ((len (length input))
(i 0)
- (state (or initial-state
- (its-get-start-state (symbol-value its-current-map)))))
+ (state (its-get-start-state (symbol-value its-current-map)))
+ brand-new next-state key)
+ (setq its-parent-states nil)
(while (< i len)
- (setq state
- (or (its-get-next-state state (aref input i))
- (if build-if-none
- (let ((keyseq (substring input 0 (1+ i))))
- (its-make-next-state state (aref input i) keyseq keyseq))
- (error "No such state (%s)" input)))
- i (1+ i)))
+ (setq its-parent-states (cons state its-parent-states)
+ key (aref input i)
+ i (1+ i)
+ next-state (its-get-next-state state key))
+ (cond
+ (next-state
+ (setq state next-state))
+ ((null build-if-none)
+ (error "No such state (%s)" input))
+ (t
+ (if (not (or brand-new (= i 1) (its-get-kst/t state)))
+ (its-set-interim-terminal-state state))
+ (setq state (its-make-next-state state key
+ (concat (its-get-output state)
+ (list key)))
+ brand-new t))))
+ (if (and (eq build-if-none 'dup-check) (null brand-new))
+ (error "Duplicated definition (%s)" input))
state))
+(defun its-set-interim-terminal-state (state &optional output)
+ (or output (setq output (its-get-output state)))
+ (its-make-next-state state -1 output)
+ (its-defrule-otherwise state output))
+
(defun its-defoutput (input display)
(let ((state (its-goto-state input)))
(its-set-output state display)))
(its-define-otherwise state
(its-make-otherwise output class+back))))
-(defun its-defrule* (input output)
- (let ((state (its-defrule input output)))
- (its-defrule-otherwise state output)))
-
-(defun its-make-next-state (state key keyseq output &optional back)
- (let ((next-state (its-new-state output keyseq back))
+(defun its-make-next-state (state key output &optional back)
+ (let ((next-state (its-new-state output
+ (concat (its-get-keyseq state)
+ (if (> key 0) (list key)))
+ back))
(kst (its-get-kst/t state)))
(cond
((null kst)
(defvar its-erpin-tw-close-braket "\e$(G!W\e(B" "*]") ; "\e$(G!c\e(B"
(eval-when-compile
- (defsubst its-defoutput* (input display)
- (its-set-output (its-goto-state input nil t) display))
-
(defun its-define-erpin-qingsheng (shengmu yunmu &optional y)
(let ((input (concat (car shengmu) yunmu))
- (output (concat (cdr shengmu) (if y y yunmu) "\e(0@\e(B"))
- state)
- (setq state (its-goto-state input nil t))
- (its-set-output state output)
- (its-make-next-state state -1 input output)
- (its-make-next-state state ? (concat input " ") output)
- (its-make-next-state state ?0 (concat input "0") output)
- (its-define-otherwise state (its-make-otherwise output
- its-otherwise-back-one))
- state))
+ (output (concat (cdr shengmu) (if y y yunmu) "\e(0@\e(B")))
+ (prog1
+ (its-defrule input output)
+ (its-defrule (concat input " ") output)
+ (its-defrule (concat input "0") output))))
(defmacro its-do-erpin-table (list)
`(progn
(while ss
(setq sa (caar ss) sd (cdar ss)
state (its-define-erpin-qingsheng (car ss) y y5))
- (its-make-next-state state ?1 (concat sa y 1) (concat sd y1 "\e(0@\e(B"))
- (its-make-next-state state ?2 (concat sa y 2) (concat sd y2 "\e(0@\e(B"))
- (its-make-next-state state ?3 (concat sa y 3) (concat sd y3 "\e(0@\e(B"))
- (its-make-next-state state ?4 (concat sa y 4) (concat sd y4 "\e(0@\e(B"))
+ (its-make-next-state state ?1 (concat sd y1 "\e(0@\e(B"))
+ (its-make-next-state state ?2 (concat sd y2 "\e(0@\e(B"))
+ (its-make-next-state state ?3 (concat sd y3 "\e(0@\e(B"))
+ (its-make-next-state state ?4 (concat sd y4 "\e(0@\e(B"))
(setq ss (cdr ss)))))
(defmacro its-define-erpin-table ()
(un '("z" "\e(01\e(Bn" "\e(02\e(Bn" "\e(03\e(Bn" "\e(04\e(Bn" "un" ))
(uo '("o" "u\e(0-\e(B" "u\e(0.\e(B" "u\e(0/\e(B" "u\e(00\e(B" "uo" )))
- (dolist (SHENG (list B C D F G H J K L M N P Q R S T W X Y Z I U V))
- (its-defrule (car SHENG) (cdr SHENG)))
-
(its-do-erpin-table
(((O B C D F G H K L M N P S T W Y Z I U V) . a)
((O B C D G H K L M N P S T W Z I U V) . ai)
((J Q X) . (cons "t" (cdr ing )))
((J Q X) . (cons "q" (cdr iu )))))
+ (dolist (SHENG (list B C D F G H J K L M N P Q R S T W X Y Z I U V))
+ (its-defoutput (car SHENG) (cdr SHENG)))
+
(its-define-erpin-qingsheng H "m")
(its-define-erpin-qingsheng H "n" "ng")
(its-define-erpin-qingsheng O "m")
(its-defrule "on4" "\e(0?@\e(B"))))
(define-its-state-machine its-erpin-cn-map
- "erpin-cn" "\e$A6~\e(BG" 'Chinese-GB
+ "erpin-cn" "\e$A6~\e(BG" Chinese-GB
"Map for Erpin input. (Chinese-GB)"
(defconst its-quanjiao-escape "Z")
(its-defrule-select-mode-temporally "Q" quanjiao-downcase-cn)
(its-define-erpin-table)
- (its-defoutput* "b " "\e$A2;\e(B")
- (its-defoutput* "c " "\e$A2E\e(B")
- (its-defoutput* "ch " "\e$A3v\e(B")
- (its-defoutput* "d " "\e$A5D\e(B")
- (its-defoutput* "f " "\e$A74\e(B")
- (its-defoutput* "g " "\e$A8v\e(B")
- (its-defoutput* "h " "\e$A:M\e(B")
- (its-defoutput* "i " "\e$AR;\e(B")
- (its-defoutput* "j " "\e$A>M\e(B")
- (its-defoutput* "k " "\e$A?I\e(B")
- (its-defoutput* "l " "\e$AAK\e(B")
- (its-defoutput* "m " "\e$AC?\e(B")
- (its-defoutput* "n " "\e$ADj\e(B")
- (its-defoutput* "p " "\e$AEz\e(B")
- (its-defoutput* "q " "\e$AH%\e(B")
- (its-defoutput* "r " "\e$AHU\e(B")
- (its-defoutput* "s " "\e$AJG\e(B")
- (its-defoutput* "u " "\e$AIO\e(B")
- (its-defoutput* "t " "\e$AK{\e(B")
- (its-defoutput* "w " "\e$ANR\e(B")
- (its-defoutput* "x " "\e$AOr\e(B")
- (its-defoutput* "y " "\e$ASV\e(B")
- (its-defoutput* "z " "\e$ATZ\e(B")
- (its-defoutput* "v " "\e$AWE\e(B")
+ (its-defrule "b " "\e$A2;\e(B")
+ (its-defrule "c " "\e$A2E\e(B")
+ (its-defrule "ch " "\e$A3v\e(B")
+ (its-defrule "d " "\e$A5D\e(B")
+ (its-defrule "f " "\e$A74\e(B")
+ (its-defrule "g " "\e$A8v\e(B")
+ (its-defrule "h " "\e$A:M\e(B")
+ (its-defrule "i " "\e$AR;\e(B")
+ (its-defrule "j " "\e$A>M\e(B")
+ (its-defrule "k " "\e$A?I\e(B")
+ (its-defrule "l " "\e$AAK\e(B")
+ (its-defrule "m " "\e$AC?\e(B")
+ (its-defrule "n " "\e$ADj\e(B")
+ (its-defrule "p " "\e$AEz\e(B")
+ (its-defrule "q " "\e$AH%\e(B")
+ (its-defrule "r " "\e$AHU\e(B")
+ (its-defrule "s " "\e$AJG\e(B")
+ (its-defrule "u " "\e$AIO\e(B")
+ (its-defrule "t " "\e$AK{\e(B")
+ (its-defrule "w " "\e$ANR\e(B")
+ (its-defrule "x " "\e$AOr\e(B")
+ (its-defrule "y " "\e$ASV\e(B")
+ (its-defrule "z " "\e$ATZ\e(B")
+ (its-defrule "v " "\e$AWE\e(B")
(dolist (ascii '(("0" . "\e$A#0\e(B") ("1" . "\e$A#1\e(B") ("2" . "\e$A#2\e(B") ("3" . "\e$A#3\e(B")
("4" . "\e$A#4\e(B") ("5" . "\e$A#5\e(B") ("6" . "\e$A#6\e(B") ("7" . "\e$A#7\e(B")
(its-defrule "!" "\e$A#!\e(B"))
(define-its-state-machine its-erpin-tw-map
- "erpin-tw" "\e$(GD(\e(BC" 'Chinese-CNS
+ "erpin-tw" "\e$(GD(\e(BC" Chinese-CNS
"Map for Erpin input."
(defconst its-quanjiao-escape "Z")
(its-defrule-select-mode-temporally "Q" quanjiao-downcase-cn)
(its-define-erpin-table)
- (its-defoutput* "b " "\e$(GDb\e(B")
- (its-defoutput* "c " "\e$(GD_\e(B")
- (its-defoutput* "ch " "\e$(GEx\e(B")
- (its-defoutput* "d " "\e$(GN{\e(B")
- (its-defoutput* "f " "\e$(GE0\e(B")
- (its-defoutput* "g " "\e$(GT6\e(B")
- (its-defoutput* "h " "\e$(GLO\e(B")
- (its-defoutput* "i " "\e$(GD!\e(B")
- (its-defoutput* "j " "\e$(G^s\e(B")
- (its-defoutput* "k " "\e$(GF+\e(B")
- (its-defoutput* "l " "\e$(GD'\e(B")
- (its-defoutput* "m " "\e$(GJd\e(B")
- (its-defoutput* "n " "\e$(GH!\e(B")
- (its-defoutput* "p " "\e$(GJG\e(B")
- (its-defoutput* "q " "\e$(GF*\e(B")
- (its-defoutput* "r " "\e$(GEJ\e(B")
- (its-defoutput* "s " "\e$(GQR\e(B")
- (its-defoutput* "u " "\e$(GD8\e(B")
- (its-defoutput* "t " "\e$(GEl\e(B")
- (its-defoutput* "w " "\e$(GJ<\e(B")
- (its-defoutput* "x " "\e$(GGW\e(B")
- (its-defoutput* "y " "\e$(GD4\e(B")
- (its-defoutput* "z " "\e$(GGc\e(B")
- (its-defoutput* "v " "\e$(Gaa\e(B")
+ (its-defrule "b " "\e$(GDb\e(B")
+ (its-defrule "c " "\e$(GD_\e(B")
+ (its-defrule "ch " "\e$(GEx\e(B")
+ (its-defrule "d " "\e$(GN{\e(B")
+ (its-defrule "f " "\e$(GE0\e(B")
+ (its-defrule "g " "\e$(GT6\e(B")
+ (its-defrule "h " "\e$(GLO\e(B")
+ (its-defrule "i " "\e$(GD!\e(B")
+ (its-defrule "j " "\e$(G^s\e(B")
+ (its-defrule "k " "\e$(GF+\e(B")
+ (its-defrule "l " "\e$(GD'\e(B")
+ (its-defrule "m " "\e$(GJd\e(B")
+ (its-defrule "n " "\e$(GH!\e(B")
+ (its-defrule "p " "\e$(GJG\e(B")
+ (its-defrule "q " "\e$(GF*\e(B")
+ (its-defrule "r " "\e$(GEJ\e(B")
+ (its-defrule "s " "\e$(GQR\e(B")
+ (its-defrule "u " "\e$(GD8\e(B")
+ (its-defrule "t " "\e$(GEl\e(B")
+ (its-defrule "w " "\e$(GJ<\e(B")
+ (its-defrule "x " "\e$(GGW\e(B")
+ (its-defrule "y " "\e$(GD4\e(B")
+ (its-defrule "z " "\e$(GGc\e(B")
+ (its-defrule "v " "\e$(Gaa\e(B")
(dolist (ascii '(("0" . "\e$(G$!\e(B") ("1" . "\e$(G$"\e(B") ("2" . "\e$(G$#\e(B") ("3" . "\e$(G$$\e(B")
("4" . "\e$(G$%\e(B") ("5" . "\e$(G$&\e(B") ("6" . "\e$(G$'\e(B") ("7" . "\e$(G$(\e(B")
(its-defrule "=" "\e$A#=\e(B") (its-defrule "`" "\e$A#`\e(B")
(its-defrule "\\" "\e$A#\\e(B") (its-defrule "|" "\e$A#|\e(B")
(its-defrule "_" "\e$A#_\e(B") (its-defrule "+" "\e$A#+\e(B")
- (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
+ (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$A#}\e(B")
(its-defrule "\"" "\e$A#"\e(B") (its-defrule "'" "\e$A#'\e(B")
(its-defrule "<" "\e$A#<\e(B") (its-defrule ">" "\e$A#>\e(B"))
(progn
(its-defrule "=" "\e$(G"8\e(B") (its-defrule "`" "\e$(G!j\e(B")
(its-defrule "\\" "\e$(G"b\e(B") (its-defrule "|" "\e$(G"^\e(B")
(its-defrule "_" "\e$(G"%\e(B") (its-defrule "+" "\e$(G"0\e(B")
- (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$(G!a\e(B")
+ (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
(its-defrule "\"" "\e$(G!i\e(B") (its-defrule "'" "\e$(G!k\e(B")
(its-defrule "<" "\e$(G"6\e(B") (its-defrule ">" "\e$(G"7\e(B"))
(progn
(eval-when-compile
(require 'its)
- (require 'egg-edep)
(require 'cl))
(defvar its-hangul-enable-jeonkak-alphabet
(eval-when-compile
(defun its-define-hangul-key (key output)
- (let ((out (string-to-char output))
- (state (its-goto-state key nil t)))
- (setq its-hangul-key-alist (cons (cons out (string-to-char key))
- its-hangul-key-alist))
- (its-set-output state output)
- (its-make-next-state state -1 (its-get-keyseq state) output)
- (its-defrule-otherwise state output)))
+ (setq its-hangul-key-alist
+ (cons (cons (string-to-char output)
+ (string-to-char key))
+ its-hangul-key-alist))
+ (its-defrule key output))
(defun its-define-hangul-successor-list (keyseq)
(let ((pair (assq (aref keyseq 0) its-hangul-successor-list)))
(setcdr pair (its-hangul-make-successor (cdr pair) keyseq))))))
(defun its-defrule-hangul (input output)
- (let ((state (its-get-start-state (symbol-value its-current-map)))
- (len (length input)) (i 0)
- keyseq key prev-out out pair)
- (while (< i len)
- (setq key (aref input i)
- next-state (its-get-next-state state key)
- i (1+ i))
- (if next-state
- (setq prev-out out
- out (its-get-output next-state)
- state next-state)
- (setq keyseq (substring input 0 i)
- prev-out out
- out (if (= i len) output (concat out (list key)))
- state (its-make-next-state state key keyseq out))
- (its-make-next-state state -1 keyseq out)
- (its-defrule-otherwise state out)))
- (if (and (= (egg-chars-in-period prev-out 0 (length prev-out)) 1)
+ (let* ((state (its-defrule input output nil nil))
+ (prev-out (its-get-output (car its-parent-states)))
+ pair)
+ (if (and (= (length (string-to-list prev-out)) 1)
(> (string-to-char prev-out) ?\377)
- (setq pair (assq (aref keyseq (1- len))
+ (setq pair (assq (string-to-char (substring input -1))
its-hangul-successor-list)))
- (its-defrule-otherwise state prev-out (cdr pair) -2))))
+ (progn
+ (its-set-interim-terminal-state state)
+ (its-defrule-otherwise state prev-out (cdr pair) -2)))))
(defmacro its-define-hangul (&rest list)
(cons 'progn
list))))
(define-its-state-machine its-hangul-map
- "hangul" "\e$(CGQ\e(B" 'Korean
+ "hangul" "\e$(CGQ\e(B" Korean
"Map for Hangul input. (Korean)"
(defconst its-jeonkak-escape "Z")
(defvar its-han-kata-horizontal "\e(I0\e(B" "*-") ; "\e$B!]\e(B"
(define-its-state-machine its-han-kata-map
- "roma-han-kata" "\e(I11\e(B" "Japanese"
+ "roma-han-kata" "\e(I11\e(B" Japanese
"Map for Romaji-Hankaku-Katakana translation. (Japanese)"
(defconst its-hankaku-escape "~") ;; Escape character to Hankaku inputs
(dolist (q1 '("b" "m" "p"))
(its-defrule (concat "m" q1) "\e(I]\e(B" -1))
- (its-defrule "N" "\e(I]\e(B")
-
- (let ((state (its-goto-state "n" nil t)))
- (its-make-next-state state -1 "n" "\e(I]\e(B")
- (its-make-next-state state ?' "n" "\e(I]\e(B")
- (its-defrule-otherwise state "\e(I]\e(B"))
+ (its-defrule* "n" "\e(I]\e(B")
+ (its-defrule "n'" "\e(I]\e(B")
+ (its-defrule "N" "\e(I]\e(B")
(let ((small '"x" ))
(its-defrule (concat small "a") "\e(I'\e(B")
(define-its-state-machine-append its-han-kata-map
(if its-han-kata-enable-double-n
- (its-defrule "nn" "\e(I]\e(B")
- (its-defrule "nn" "\e(I]\e(B" -1))
+ (its-defrule "nn" "\e(I]\e(B"))
(its-defrule "-" its-han-kata-horizontal)
(its-defrule "[" its-han-kata-open-bracket)
(defvar its-hira-horizontal "\e$B!<\e(B" "*-") ; "\e$B!]\e(B"
(define-its-state-machine its-hira-map
- "roma-kana" "\e$B$"\e(B" 'Japanese
+ "roma-kana" "\e$B$"\e(B" Japanese
"Map for Romaji-Hiragana translation. (Japanese)"
(defconst its-zenkaku-escape "Z") ;; Escape character to Zenkaku inputs
(dolist (q1 '("b" "m" "p"))
(its-defrule (concat "m" q1) "\e$B$s\e(B" -1))
- (its-defrule "N" "\e$B$s\e(B")
-
- (let ((state (its-goto-state "n" nil t)))
- (its-make-next-state state -1 "n" "\e$B$s\e(B")
- (its-make-next-state state ?' "n" "\e$B$s\e(B")
- (its-defrule-otherwise state "\e$B$s\e(B"))
+ (its-defrule* "n" "\e$B$s\e(B")
+ (its-defrule "n'" "\e$B$s\e(B")
+ (its-defrule "N" "\e$B$s\e(B")
(let ((small '"x" ))
(its-defrule (concat small "a") "\e$B$!\e(B")
(define-its-state-machine-append its-hira-map
(if its-hira-enable-double-n
- (its-defrule "nn" "\e$B$s\e(B")
- (its-defrule "nn" "\e$B$s\e(B" -1))
+ (its-defrule "nn" "\e$B$s\e(B"))
(its-defrule "-" its-hira-horizontal)
(its-defrule "[" its-hira-open-bracket)
(require 'its))
(define-its-state-machine its-jeonkak-up-map
- "jeonkak-upcase" "\e$(C#A\e(B" 'Korean
+ "jeonkak-upcase" "\e$(C#A\e(B" Korean
"Map for jeonkak-upcase input."
(dolist (ascii '(("1" . "\e$(C#1\e(B") ("2" . "\e$(C#2\e(B") ("3" . "\e$(C#3\e(B") ("4" . "\e$(C#4\e(B")
(its-defrule in out))))
(define-its-state-machine its-jeonkak-down-map
- "jeonkak-downcase" "\e$(C#a\e(B" 'Korean
+ "jeonkak-downcase" "\e$(C#a\e(B" Korean
"Map for jeonkak-downcase input."
(dolist (ascii '(("1" . "\e$(C#1\e(B") ("2" . "\e$(C#2\e(B") ("3" . "\e$(C#3\e(B") ("4" . "\e$(C#4\e(B")
(defvar its-kata-horizontal "\e$B!<\e(B" "*-") ; "\e$B!]\e(B"
(define-its-state-machine its-kata-map
- "roma-kata" "\e$B%"\e(B" 'Japanese
+ "roma-kata" "\e$B%"\e(B" Japanese
"Map for Romaji-Katakana translation. (Japanese)"
(defconst its-zenkaku-escape "Z") ;; Escape character to Zenkaku inputs
(dolist (q1 '("b" "m" "p"))
(its-defrule (concat "m" q1) "\e$B%s\e(B" -1))
- (its-defrule "N" "\e$B%s\e(B")
-
- (let ((state (its-goto-state "n" nil t)))
- (its-make-next-state state -1 "n" "\e$B%s\e(B")
- (its-make-next-state state ?' "n" "\e$B%s\e(B")
- (its-defrule-otherwise state "\e$B%s\e(B"))
+ (its-defrule* "n" "\e$B%s\e(B")
+ (its-defrule "n'" "\e$B%s\e(B")
+ (its-defrule "N" "\e$B%s\e(B")
(let ((small '"x" ))
(its-defrule (concat small "a") "\e$B%!\e(B")
(define-its-state-machine-append its-kata-map
(if its-kata-enable-double-n
- (its-defrule "nn" "\e$B%s\e(B")
- (its-defrule "nn" "\e$B%s\e(B" -1))
+ (its-defrule "nn" "\e$B%s\e(B"))
(its-defrule "-" its-kata-horizontal)
(its-defrule "[" its-kata-open-bracket)
(defvar its-pinyin-cn-open-braket "\e$A!8\e(B" "*[") ; "\e$A#[\e(B"
(defvar its-pinyin-cn-close-braket "\e$A!9\e(B" "*]") ; "\e$A#]\e(B"
-(defvar its-pinyin-tw-enable-quanjioao-alphabet t "*Enable Quanjiao alphabet")
+(defvar its-pinyin-tw-enable-quanjioao-alphabet
+ (if (boundp 'its-enable-fullwidth-alphabet)
+ its-enable-fullwidth-alphabet
+ t)
+ "*Enable Quanjiao alphabet")
+
(defvar its-pinyin-tw-open-braket "\e$(G!V\e(B" "*[") ; "\e$(G!b\e(B "
(defvar its-pinyin-tw-close-braket "\e$(G!W\e(B" "*]") ; "\e$(G!c\e(B"
(eval-when-compile
- (defconst its-pinyin-term
- (char-to-string (make-char 'chinese-sisheng ?@)))
-
- (defsubst its-defoutput* (input display)
- (its-set-output (its-goto-state input nil t) display))
-
- (defun its-prev-terminal-state (input)
- (let ((len (length input))
- (state (its-get-start-state (symbol-value its-current-map)))
- (i 0) (ret nil) kst ks)
- (while (and (< i len)
- (setq state (its-get-next-state state (aref input i))))
- (if (or (null (its-kst-p (setq kst (its-get-kst/t state))))
- (mapcan (lambda (eob) (if (eq (its-eob-back eob) -1) (list t)))
- (cdr kst))
- (and (setq ks (assq -1 (car kst)))
- (null (its-get-kst/t (cdr ks)))))
- (setq ret state))
- (setq i (1+ i)))
- ret))
+ (defun its-prev-terminal-state (state-list)
+ (while (and state-list
+ (null (its-get-next-state (car state-list) -1)))
+ (setq state-list (cdr state-list)))
+ (car state-list))
(defun its-define-qingsheng (shengmu yunmu &optional s y)
(let ((input (concat shengmu yunmu))
- (output (concat (if s s (capitalize shengmu))
- (if y y yunmu)
- its-pinyin-term))
- state term kst i len c+b)
- (setq state (its-goto-state input nil t))
- (its-make-next-state state -1 input output)
- (its-make-next-state state ? (concat input " ") output)
- (its-make-next-state state ?0 (concat input "0") output)
- (its-define-otherwise
- state (its-make-otherwise output its-otherwise-back-one))
- (setq term (its-prev-terminal-state (substring input 0 -1)))
- (if term
- (progn
- (setq len (length (its-get-keyseq term))
- i len
- output (car (rassoc '(nil . -1) (cdr (its-get-kst/t term)))))
- (while (null
- (eq (setq term (its-get-next-state term (aref input i)))
- state))
- (setq i (1+ i) kst (its-get-kst/t term))
- (if (null (assq -1 (car kst)))
- (its-make-next-state term -1
- (its-get-keyseq term) output (- len i)))
- (setq c+b (its-make-class+back nil (1- (- len i))))
- (if (null (rassoc c+b (cdr kst)))
- (its-define-otherwise term
- (its-make-otherwise output c+b))))))
+ (output (concat (if s s (capitalize shengmu)) (if y y yunmu) "\e(0@\e(B"))
+ state term-state)
+ (setq state (its-defrule* input output))
+ (its-make-next-state state ? output)
+ (its-make-next-state state ?0 output)
+ (setq term-state (its-prev-terminal-state its-parent-states))
+ (if term-state
+ (let ((back (- (length (its-get-keyseq term-state)) (length input)))
+ (output (its-get-output (its-get-next-state term-state -1)))
+ (parents its-parent-states))
+ (while (null (eq (car parents) term-state))
+ (its-make-next-state (car parents) -1 output (1+ back))
+ (its-defrule-otherwise (car parents) output nil back)
+ (setq back (1+ back)
+ parents (cdr parents)))))
state))
(defmacro its-do-sisheng-table (list)
(ss (list ,@shengmu)) s cs state i)
(while ss
(setq s (car ss)
+ ss (cdr ss)
cs (capitalize s)
state (its-define-qingsheng s y cs qing))
- (setq i 1)
- (while (<= i 4)
- (its-make-next-state state (+ ?0 i)
- (concat s y i)
- (concat cs (nth i ,yunmu) its-pinyin-term))
- (setq i (1+ i)))
- (setq ss (cdr ss)))))
+ (its-make-next-state state ?1 (concat cs (nth 1 ,yunmu) "\e(0@\e(B"))
+ (its-make-next-state state ?2 (concat cs (nth 2 ,yunmu) "\e(0@\e(B"))
+ (its-make-next-state state ?3 (concat cs (nth 3 ,yunmu) "\e(0@\e(B"))
+ (its-make-next-state state ?4 (concat cs (nth 4 ,yunmu) "\e(0@\e(B")))))
(defmacro its-define-pinyin-table ()
'(let ((- "") (B "b") (C "c") (D "d") (F "f") (G "g") (H "h")
(UN '("un" "\e(01\e(Bn" "\e(02\e(Bn" "\e(03\e(Bn" "\e(04\e(Bn" "un" ))
(UO '("uo" "u\e(0-\e(B" "u\e(0.\e(B" "u\e(0/\e(B" "u\e(00\e(B" "uo" )))
+ (its-define-qingsheng "hm" "")
+ (its-define-qingsheng "hng" "")
+ (its-defrule* "m" "m\e(0@\e(B")
+ (its-defrule "m0" "m\e(0@\e(B")
+ (its-defrule* "n" "n\e(0@\e(B")
+ (its-defrule "n0" "n\e(0@\e(B")
+ (its-defrule "n2" "\e(0=@\e(B")
+ (its-defrule "n3" "\e(0>@\e(B")
+ (its-defrule "n4" "\e(0?@\e(B")
+ (its-define-qingsheng "" "ng")
+
(its-do-sisheng-table
(((- B C D F G H K L M N P S T W Y Z CH SH ZH ) A)
((- B C D G H K L M N P S T W Z CH SH ZH ) AI)
((J Q X) (cons "ei" (cdr IE )))
((J Q X) (cons "en" (cdr IN )))
((J Q X) (cons "eng" (cdr ING )))
- ((J Q X) (cons "ou" (cdr IU )))))
-
- (its-define-qingsheng "hm" "")
- (its-define-qingsheng "hng" "")
- (its-define-qingsheng "" "ng")
-
- (its-define-qingsheng "" "m")
- (its-define-qingsheng "" "n")
- (its-defrule "n2" "\e(0=@\e(B")
- (its-defrule "n3" "\e(0>@\e(B")
- (its-defrule "n4" "\e(0?@\e(B"))))
+ ((J Q X) (cons "ou" (cdr IU ))))))))
(define-its-state-machine its-pinyin-cn-map
- "pinyin-cn" "\e$AF4\e(BG" 'Chinese-GB
+ "pinyin-cn" "\e$AF4\e(BG" Chinese-GB
"Map for Pinyin input. (Chinese-GB)"
(defconst its-quanjiao-escape "Z")
(its-defrule-select-mode-temporally "Q" quanjiao-downcase-cn)
(its-define-pinyin-table)
- (its-defoutput* "b " "\e$A2;\e(B")
- (its-defoutput* "c " "\e$A2E\e(B")
- (its-defoutput* "ch " "\e$A3v\e(B")
- (its-defoutput* "d " "\e$A5D\e(B")
- (its-defoutput* "f " "\e$A74\e(B")
- (its-defoutput* "g " "\e$A8v\e(B")
- (its-defoutput* "h " "\e$A:M\e(B")
- (its-defoutput* "i " "\e$AR;\e(B")
- (its-defoutput* "j " "\e$A>M\e(B")
- (its-defoutput* "k " "\e$A?I\e(B")
- (its-defoutput* "l " "\e$AAK\e(B")
- (its-defoutput* "m " "\e$AC?\e(B")
- (its-defoutput* "n " "\e$ADj\e(B")
- (its-defoutput* "p " "\e$AEz\e(B")
- (its-defoutput* "q " "\e$AH%\e(B")
- (its-defoutput* "r " "\e$AHU\e(B")
- (its-defoutput* "s " "\e$AJG\e(B")
- (its-defoutput* "sh " "\e$AIO\e(B")
- (its-defoutput* "t " "\e$AK{\e(B")
- (its-defoutput* "w " "\e$ANR\e(B")
- (its-defoutput* "x " "\e$AOr\e(B")
- (its-defoutput* "y " "\e$ASV\e(B")
- (its-defoutput* "z " "\e$ATZ\e(B")
- (its-defoutput* "zh " "\e$AWE\e(B")
+ (its-defrule "b " "\e$A2;\e(B")
+ (its-defrule "c " "\e$A2E\e(B")
+ (its-defrule "ch " "\e$A3v\e(B")
+ (its-defrule "d " "\e$A5D\e(B")
+ (its-defrule "f " "\e$A74\e(B")
+ (its-defrule "g " "\e$A8v\e(B")
+ (its-defrule "h " "\e$A:M\e(B")
+ (its-defrule "i " "\e$AR;\e(B")
+ (its-defrule "j " "\e$A>M\e(B")
+ (its-defrule "k " "\e$A?I\e(B")
+ (its-defrule "l " "\e$AAK\e(B")
+ (its-defrule "m " "\e$AC?\e(B")
+ (its-defrule "n " "\e$ADj\e(B")
+ (its-defrule "p " "\e$AEz\e(B")
+ (its-defrule "q " "\e$AH%\e(B")
+ (its-defrule "r " "\e$AHU\e(B")
+ (its-defrule "s " "\e$AJG\e(B")
+ (its-defrule "sh " "\e$AIO\e(B")
+ (its-defrule "t " "\e$AK{\e(B")
+ (its-defrule "w " "\e$ANR\e(B")
+ (its-defrule "x " "\e$AOr\e(B")
+ (its-defrule "y " "\e$ASV\e(B")
+ (its-defrule "z " "\e$ATZ\e(B")
+ (its-defrule "zh " "\e$AWE\e(B")
(dolist (ascii '(("0" . "\e$A#0\e(B") ("1" . "\e$A#1\e(B") ("2" . "\e$A#2\e(B") ("3" . "\e$A#3\e(B")
("4" . "\e$A#4\e(B") ("5" . "\e$A#5\e(B") ("6" . "\e$A#6\e(B") ("7" . "\e$A#7\e(B")
(its-defrule "!" "\e$A#!\e(B"))
(define-its-state-machine its-pinyin-tw-map
- "pinyin-tw" "\e$(GQ;\e(BC" 'Chinese-CNS
+ "pinyin-tw" "\e$(GQ;\e(BC" Chinese-CNS
"Map for Pinyin input."
(defconst its-quanjiao-escape "Z")
(its-defrule-select-mode-temporally "Q" quanjiao-downcase-tw)
(its-define-pinyin-table)
- (its-defoutput* "b " "\e$(GDb\e(B")
- (its-defoutput* "c " "\e$(GD_\e(B")
- (its-defoutput* "ch " "\e$(GEx\e(B")
- (its-defoutput* "d " "\e$(GN{\e(B")
- (its-defoutput* "f " "\e$(GE0\e(B")
- (its-defoutput* "g " "\e$(GT6\e(B")
- (its-defoutput* "h " "\e$(GLO\e(B")
- (its-defoutput* "i " "\e$(GD!\e(B")
- (its-defoutput* "j " "\e$(G^s\e(B")
- (its-defoutput* "k " "\e$(GF+\e(B")
- (its-defoutput* "l " "\e$(GD'\e(B")
- (its-defoutput* "m " "\e$(GJd\e(B")
- (its-defoutput* "n " "\e$(GH!\e(B")
- (its-defoutput* "p " "\e$(GJG\e(B")
- (its-defoutput* "q " "\e$(GF*\e(B")
- (its-defoutput* "r " "\e$(GEJ\e(B")
- (its-defoutput* "s " "\e$(GQR\e(B")
- (its-defoutput* "sh " "\e$(GD8\e(B")
- (its-defoutput* "t " "\e$(GEl\e(B")
- (its-defoutput* "w " "\e$(GJ<\e(B")
- (its-defoutput* "x " "\e$(GGW\e(B")
- (its-defoutput* "y " "\e$(GD4\e(B")
- (its-defoutput* "z " "\e$(GGc\e(B")
- (its-defoutput* "zh " "\e$(Gaa\e(B")
+ (its-defrule "b " "\e$(GDb\e(B")
+ (its-defrule "c " "\e$(GD_\e(B")
+ (its-defrule "ch " "\e$(GEx\e(B")
+ (its-defrule "d " "\e$(GN{\e(B")
+ (its-defrule "f " "\e$(GE0\e(B")
+ (its-defrule "g " "\e$(GT6\e(B")
+ (its-defrule "h " "\e$(GLO\e(B")
+ (its-defrule "i " "\e$(GD!\e(B")
+ (its-defrule "j " "\e$(G^s\e(B")
+ (its-defrule "k " "\e$(GF+\e(B")
+ (its-defrule "l " "\e$(GD'\e(B")
+ (its-defrule "m " "\e$(GJd\e(B")
+ (its-defrule "n " "\e$(GH!\e(B")
+ (its-defrule "p " "\e$(GJG\e(B")
+ (its-defrule "q " "\e$(GF*\e(B")
+ (its-defrule "r " "\e$(GEJ\e(B")
+ (its-defrule "s " "\e$(GQR\e(B")
+ (its-defrule "sh " "\e$(GD8\e(B")
+ (its-defrule "t " "\e$(GEl\e(B")
+ (its-defrule "w " "\e$(GJ<\e(B")
+ (its-defrule "x " "\e$(GGW\e(B")
+ (its-defrule "y " "\e$(GD4\e(B")
+ (its-defrule "z " "\e$(GGc\e(B")
+ (its-defrule "zh " "\e$(Gaa\e(B")
(dolist (ascii '(("0" . "\e$(G$!\e(B") ("1" . "\e$(G$"\e(B") ("2" . "\e$(G$#\e(B") ("3" . "\e$(G$$\e(B")
("4" . "\e$(G$%\e(B") ("5" . "\e$(G$&\e(B") ("6" . "\e$(G$'\e(B") ("7" . "\e$(G$(\e(B")
(its-defrule "=" "\e$A#=\e(B") (its-defrule "`" "\e$A#`\e(B")
(its-defrule "\\" "\e$A#\\e(B") (its-defrule "|" "\e$A#|\e(B")
(its-defrule "_" "\e$A#_\e(B") (its-defrule "+" "\e$A#+\e(B")
- (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
+ (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$A#}\e(B")
(its-defrule "\"" "\e$A#"\e(B") (its-defrule "'" "\e$A#'\e(B")
(its-defrule "<" "\e$A#<\e(B") (its-defrule ">" "\e$A#>\e(B"))
(progn
(its-defrule "=" "\e$(G"8\e(B") (its-defrule "`" "\e$(G!j\e(B")
(its-defrule "\\" "\e$(G"b\e(B") (its-defrule "|" "\e$(G"^\e(B")
(its-defrule "_" "\e$(G"%\e(B") (its-defrule "+" "\e$(G"0\e(B")
- (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$(G!a\e(B")
+ (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
(its-defrule "\"" "\e$(G!i\e(B") (its-defrule "'" "\e$(G!k\e(B")
(its-defrule "<" "\e$(G"6\e(B") (its-defrule ">" "\e$(G"7\e(B"))
(progn
(require 'its))
(define-its-state-machine its-quanjiao-up-cn-map
- "quanjiao-upcase-cn" "\e$A#A\e(B" 'Chinese-GB
+ "quanjiao-upcase-cn" "\e$A#A\e(B" Chinese-GB
"Map for quanjiao-upcase input. (Chinese-GB)"
(dolist (ascii '(("0" . "\e$A#0\e(B") ("1" . "\e$A#1\e(B") ("2" . "\e$A#2\e(B") ("3" . "\e$A#3\e(B")
(its-defrule in out))))
(define-its-state-machine its-quanjiao-down-cn-map
- "quanjiao-downcase-cn" "\e$A#a\e(B" 'Chinese-GB
+ "quanjiao-downcase-cn" "\e$A#a\e(B" Chinese-GB
"Map for quanjiao-downcase input. (Chinese-GB)"
(dolist (ascii '(("0" . "\e$A#0\e(B") ("1" . "\e$A#1\e(B") ("2" . "\e$A#2\e(B") ("3" . "\e$A#3\e(B")
(its-defrule in out))))
(define-its-state-machine its-quanjiao-up-tw-map
- "quanjiao-upcase-tw" "\e$(G$A\e(B" 'Chinese-CNS
+ "quanjiao-upcase-tw" "\e$(G$A\e(B" Chinese-CNS
"Map for quanjiao-upcase input. (Chinese-CNS)"
(dolist (ascii '(("0" . "\e$(G$!\e(B") ("1" . "\e$(G$"\e(B") ("2" . "\e$(G$#\e(B") ("3" . "\e$(G$$\e(B")
(its-defrule in out))))
(define-its-state-machine its-quanjiao-down-tw-map
- "quanjiao-downcase-tw" "\e$(G$[\e(B" 'Chinese-CNS
+ "quanjiao-downcase-tw" "\e$(G$[\e(B" Chinese-CNS
"Map for quanjiao-downcase input. (Chinese-CNS)"
(dolist (ascii '(("0" . "\e$(G$!\e(B") ("1" . "\e$(G$"\e(B") ("2" . "\e$(G$#\e(B") ("3" . "\e$(G$$\e(B")
(require 'its))
(define-its-state-machine its-zenkaku-up-map
- "zenkaku-upcase" "\e$B#A\e(B" 'Japanese
+ "zenkaku-upcase" "\e$B#A\e(B" Japanese
"Map for zenkaku-upcase input."
(dolist (ascii '(("0" . "\e$B#0\e(B") ("1" . "\e$B#1\e(B") ("2" . "\e$B#2\e(B") ("3" . "\e$B#3\e(B")
(its-defrule in out))))
(define-its-state-machine its-zenkaku-down-map
- "zenkaku-downcase" "\e$B#a\e(B" 'Japanese
+ "zenkaku-downcase" "\e$B#a\e(B" Japanese
"Map for zenkaku-downcase input."
(dolist (ascii '(("0" . "\e$B#0\e(B") ("1" . "\e$B#1\e(B") ("2" . "\e$B#2\e(B") ("3" . "\e$B#3\e(B")
,@(mapcar (lambda (syl) `(its-define-zhuyin ,@syl))
list)))
- (defmacro its-define-zhuyin (shengmu yunmu1 &optional yunmu2 qing-only)
+ (defmacro its-define-zhuyin (shengmu yunmu1 &optional yunmu2 qingsheng)
`(let ((s (list ,@shengmu))
(yi (concat (car ,yunmu1) (car ,yunmu2)))
(yo (concat (nth 1 ,yunmu1) (nth 1 ,yunmu2)))
- (tone (if ,qing-only "\e(0A\e(B" "\e(0@\e(B"))
+ (tone (if ,qingsheng "\e(0A\e(B" "\e(0@\e(B"))
in out out1 state)
(while s
(setq in (concat (car (car s)) yi)
out (concat (nth 1 (car s)) yo)
out1 (concat out tone)
- state (its-goto-state in nil t))
- (if (and ,qing-only (its-get-kst/t state))
- (its-set-output state out)
- (its-set-output state out1))
- (its-make-next-state state -1 in out1)
- (its-make-next-state state ? (concat in " ") out1)
- (its-define-otherwise state (its-make-otherwise
- out1
- its-otherwise-back-one))
- ,(if qing-only
- nil
- '(progn
- (its-make-next-state state ?1 (concat in 1) (concat out "\e(0A\e(B"))
- (its-make-next-state state ?2 (concat in 2) (concat out "\e(0B\e(B"))
- (its-make-next-state state ?3 (concat in 3) (concat out "\e(0C\e(B"))
- (its-make-next-state state ?4 (concat in 4) (concat out "\e(0D\e(B"))))
- (setq s (cdr s)))))
+ state (its-defrule in out1)
+ s (cdr s))
+ (its-defrule (concat in " ") out1)
+ ,@(if (null qingsheng)
+ '((its-make-next-state state ?1 (concat out "\e(0A\e(B"))
+ (its-make-next-state state ?2 (concat out "\e(0B\e(B"))
+ (its-make-next-state state ?3 (concat out "\e(0C\e(B"))
+ (its-make-next-state state ?4 (concat out "\e(0D\e(B")))))))
(defmacro its-define-zhuyin-table ()
'(let ((- '("" ""))
(ER '("^" "\e(0f\e(B")) (OU '("y" "\e(0a\e(B"))
(I '("e" "\e(0g\e(B")) (U '("x" "\e(0h\e(B")) (V '("u" "\e(0i\e(B")))
- (mapcar (lambda (s) (its-defrule (car s) (nth 1 s)))
- (list B P M F D T N L G K H J Q X))
+ (its-define-zhuyin (- H) M nil t)
+ (its-define-zhuyin (- H) '("@" "@") nil t)
+ (its-define-zhuyin (- ) N nil t)
(its-do-zhuyin-table
- (((- B P M F D T N L G K H ZH CH SH Z C S ) A)
+ ((( ZH CH SH R Z C S ) -)
+ ((- B P M F D T N L G K H ZH CH SH Z C S ) A)
((- B P M F L ) O)
((- M D T N L G K H ZH CH SH R Z C S ) e)
((- B P M D T N L G K H ZH CH SH Z C S ) AI)
((- B P M F D T N L G K H ZH CH SH R Z C S ) ENG)
((- ) ER)
((- P M F D T N L G K H ZH CH SH R Z C S ) OU)
- (( ZH CH SH R Z C S ) -)
((- B P M D T N L J Q X ) I)
((- D L J Q X ) I A)
((- ) I O)
((- N L J Q X ) V E)
((- J Q X ) V AN)
((- J Q X ) V EN)
- ((- J Q X ) V ENG)
+ ((- J Q X ) V ENG)))
- ((- H) M nil t)
- ((- H) '("@" "@") nil t)
- ((- ) N nil t)))
+ (mapcar (lambda (s) (its-defoutput (car s) (nth 1 s)))
+ (list B P M F D T N L G K H J Q X))
- (its-defrule (concat (car N) 2) (concat (nth 1 N) "\e(0B\e(B"))
- (its-defrule (concat (car N) 3) (concat (nth 1 N) "\e(0C\e(B"))
- (its-defrule (concat (car N) 4) (concat (nth 1 N) "\e(0D\e(B")))))
+ (its-defrule (concat (car N) 2) (concat (nth 1 N) "\e(0B\e(B"))
+ (its-defrule (concat (car N) 3) (concat (nth 1 N) "\e(0C\e(B"))
+ (its-defrule (concat (car N) 4) (concat (nth 1 N) "\e(0D\e(B")))))
(define-its-state-machine its-zhuyin-cn-map
- "zhuyin-cn" "\e$AW"\e(BG" 'Chinese-GB
+ "zhuyin-cn" "\e$AW"\e(BG" Chinese-GB
"Map for Zhuyin input. (Chinese-GB)"
(defconst its-quanjiao-escape "Z")
(its-defrule "?" "\e$A!"\e(B"))
(define-its-state-machine its-zhuyin-tw-map
- "zhuyin-tw" "\e$(GNC\e(BC" 'Chinese-CNS
+ "zhuyin-tw" "\e$(GNC\e(BC" Chinese-CNS
"Map for Zhuyin input."
(defconst its-quanjiao-escape "Z")
(its-defrule "(" "\e$A#(\e(B") (its-defrule ")" "\e$A#)\e(B")
(its-defrule "~" "\e$A!+\e(B")
(its-defrule "=" "\e$A#=\e(B") (its-defrule "`" "\e$A#`\e(B")
- (its-defrule "\\" "\e$(G"`\e(B") (its-defrule "|" "\e$A#|\e(B")
+ (its-defrule "\\" "\e$A#\\e(B") (its-defrule "|" "\e$A#|\e(B")
(its-defrule "_" "\e$A#_\e(B") (its-defrule "+" "\e$A#+\e(B")
- (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
+ (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$A#}\e(B")
(its-defrule "\"" "\e$A#"\e(B") (its-defrule "'" "\e$A#'\e(B"))
(progn
(its-defrule "#" "#") (its-defrule "$" "$")
(its-defrule "(" "\e$(G!>\e(B") (its-defrule ")" "\e$(G!?\e(B")
(its-defrule "~" "\e$(G"D\e(B")
(its-defrule "=" "\e$(G"8\e(B") (its-defrule "`" "\e$(G!j\e(B")
- (its-defrule "\\" "\e$(G"b\e(B") (its-defrule "|" "\e$(G"^\e(B")
+ (its-defrule "\\" "\e$(G"`\e(B") (its-defrule "|" "\e$(G"^\e(B")
(its-defrule "_" "\e$(G"%\e(B") (its-defrule "+" "\e$(G"0\e(B")
- (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$(G!a\e(B")
+ (its-defrule "{" "\e$(G!B\e(B") (its-defrule "}" "\e$(G!C\e(B")
(its-defrule "\"" "\e$(G!i\e(B") (its-defrule "'" "\e$(G!k\e(B"))
(progn
(its-defrule "#" "#") (its-defrule "$" "$")