+1998-03-15 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * Makefile: Add dependencies for its-keydef.elc.
+ * egg/sj3rpc.el (sj3-open): Don't support list of hosts.
+ * its.el (its-exit-mode, its-kick-convert-region): Bug fix. Call
+ its-input-end and its-put-cursor.
+ (its-exit-mode-off-input-method): Removed.
+
+1998-03-14 KATAYAMA Yoshio <kate@pfu.co.jp>
+
+ * docomp.el (its-keydef): Undo the changes of 03-09. its.el
+ is fixed.
+
+ * egg-cnv.el (egg-current-language): New valiable.
+ (egg-bunsetsu-info): Separate bunsetsu-info and lunguage.
+ (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
+ egg-fini-other-languages): New valiable and functions for
+ handling unknown language.
+ (egg-set-current-backend): Set egg-conversion-backend-other-languages
+ when backend for specified language isn't found.
+ (egg-start-reverse-conversion): New function for reverse conversion.
+ (egg-set-conversion-backend-internal): Removed.
+ (egg-set-conversion-backend): Args are changed.
+ (egg-get-conversion-face): New function for different face for
+ every language.
+ (egg-convert-region): Make converting text read-only. Handle
+ unknown laguages and backend opening error. Rename its-lang to
+ egg-lang.
+ (egg-separate-languages): Argument use-context is added to
+ utilize context when called by its-yank. Rename its-lang to
+ egg-lang Improve speed.
+ (egg-charset-to-language): Renamed from egg-char-to-language.
+ (egg-next-part-lang egg-next-chinese-lang): Rename its-lang to
+ egg-lang.
+ (egg-conversion-map): Unbind C-\ and /. Bind C-X RET XXX to
+ its-select-XXX.
+ (egg-insert-bunsetsu): Make conversion text read-only. Separate
+ bunsetsu-info and conversion-backend.
+ (egg-insert-bunsetsu-list): Remove redundant variables.
+ (egg-beginning-of-conversion-buffer): New function.
+ (egg-end-of-conversion-buffer): New function.
+ (egg-enlarge-bunsetsu): Handle read-only text.
+ (egg-next-candidate): Handle read-only text. Bug on no candidate
+ bunsetsu is fiexed.
+ (egg-reconvert-bunsetsu-internal egg-reverse-convert-bunsetu
+ egg-reconvert-bunsetsu): New functions for reverse conversion and
+ re-conversion.
+ (egg-decide-before-point egg-abort-conversion): Handle read-only
+ text. Bug on pinyin and zhuyin mixed conversion is fixed. Allow
+ long fence.
+ (egg-select-candidate): Handle read-only text. Bug on no candidate
+ bunsetsu is fiexed.
+
+ * egg-com.el: Change coding-system from internal to iso-2022-7bit.
+
+ * egg-mlh.el (mlh-space-bar-backward-henkan): Disable temporally
+ mode selection.
+
+ * egg.el (egg-mode): Set cureent lang to conversion backend.
+ (egg-set-mode-line-title): Renamed to its-set-mode-line-title
+ and moved to its.el.
+ (egg-check-language): Removed.
+
+ * egg/sj3.el (sj3-server-port): Change from defconst to defver for
+ user customization.
+ (sj3-open sj3-get-environment): Try opening alternate servers.
+ (sj3-start-conversion): Make second argument LANGUAGE optional.
+ (egg-activate-sj3): Parameters of egg-set-conversion-backend is
+ changed.
+
+ * egg/sj3rpc.el (sj3rpc-error-message): New constant (Not yet
+ completed).
+ (sj3rpc-get-error-message): Check range of errno to avoid
+ args-out-ou-range error.
+
+ * egg/wnn.el (wnn-jport wnn-cport wnn-tport wnn-kport): New
+ variables for user customization.
+ (wnn-server-info-list wnn-server-port): Type of fourth element
+ is changed from integer to symbol.
+ (wnn-start-reverse-conversion): New function.
+ (wnn-open wnn-get-environment): Try opening alternate servers.
+ (egg-activate-wnn): Parameters of egg-set-conversion-backend is
+ changed.
+
+ * its-keydef.el (its-current-language): Moved to its.el.
+ (its-make-select-func): Remove language check (egg-check-language).
+ Add temporally mode selection.
+ (its-do-list-make-select-func): Binding of zhuyin-tw is changed to
+ `C' because conflicting zenkaku-upcase.
+
+ * its.el (its-current-select-func its-previous-select-func): New
+ variables for temporally mode selection.
+ (its-keydef requiring): Use eval-when to avoid error on using
+ compiled file.
+ (its-get-fence-face): New function for different face for
+ every language.
+ (its-put-cursor its-setup-fence-mode): Make fence read-only.
+ (its-start): Remove force-mode-line-update calling.
+ (its-restart): Add optional argument set-prop.
+ (its-self-insert-char its-backward-SYL its-forward-SYL
+ its-delete-SYL its-delete-backward-SYL its-exit-mode
+ its-delete-backward-SYL-by-keystroke its-transpose-chars
+ its-kick-convert-region its-end-of-input-buffer): Handle read-only
+ fence.
+ (its-state-machine): Accept special actions to handle temporally
+ mode selection.
+ (its-buffer-ins/del-SYL its-ins/del-SYL-batch): Handle read-only
+ fence. Property its-lang is renamed to egg-lang.
+ (its-get-next-state its-make-next-state): Add type check to avoid
+ wrong-type-argument error.
+ (its-keyseq-acceptable-p): Save informations of its-map to avoid
+ confusing on temporally mode selection.
+ (its-defrule-select-mode-temporally): New macro.
+ (its-kill-line its-cancel-input): New function.
+ (its-delete-backward-within-SYL): Bind its-current-language to
+ avoid confusing when undo is done beyond language change.
+ (its-yank its-yank-pop its-setup-yanked-portion): New functions.
+ (its-exit-mode-internal): Reset temporally selected mode. Allow
+ long fence.
+ (its-kick-convert-region-or-self-insert): New function.
+ (its-translate-region): Remove text properties completly.
+ (its-set-mode-line-title): Moved from egg.el and renamed.
+ (its-select-mode-temporally its-select-previous-mode): New functions
+ for temporally mode selection.
+
+ * leim-list-egg.el: Secondary argument for egg-activate-sj3/wnn
+ is no longer needed.
+
+ * its/hira.el: Remove the rule for "~" which destroies the rules
+ with its-hankaku-escape.
+
+ * its/pinyin.el: Implement its-pinyin-cn-enable-quanjioao-alphabet
+ and its-pinyin-tw-enable-quanjioao-alphabet.
+
+ * its/hangul.el: Implement its-hangul-enable-quanjioao-alphabet.
+
+ * its/ascii.el: New file.
+ * its/erpin.el: New file.
+ * its/hankata.el: New file.
+ * its/jeonkak.el: New file.
+ * its/kata.el: New file.
+ * its/quanjiao.el: New file.
+ * its/zenkaku.el: New file.
+ * its/zhuyin.el: New file.
+
+1998-03-14 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * egg/sj3rpc.el (sj3rpc-close): New function.
+
+ * egg/sj3.el (sj3bunsetsu-[sg]et-kugiri-changed): Rename from
+ sj3bunsetsu-get-stdy-down.
+ (sj3-end-conversion): Implement CLSTDY.
+ (sj3-fini): Implemented.
+
+1998-03-10 NIIBE Yutaka <gniibe@mri.co.jp>
+
+ * egg/sj3.el (sj3-end-conversion): Implement bunsetsu study.
+ CLSTDY not yet.
+
+ * egg/sj3rpc.el (sj3rpc-get-bunsetsu-candidates-sub): Bug fix.
+ Always add hiragana and katakana candidates.
+ (sj3-const: CLSTDY, CLSTDY_EUC): Renamed from END and END_EUC
+ according to "sj3cmd.h" of SJ3 distribution.
+ (sj3rpc-bunsetsu-stdy, sj3rpc-kugiri-stdy): New functions.
+
+ * egg-com.el (comm-format-u8-vector): New substitution.
+ (comm-format): New format 'v'.
+
1998-03-09 NIIBE Yutaka <gniibe@mri.co.jp>
* docomp.el (its-keydef): Require its-keydef when compile.
--- /dev/null
+;; -*- Lisp -*-
+(Created-By-Prcs-Version 1 2 1)
+(Project-Description "")
+(Project-Version Egg 0 14)
+(Parent-Version Egg 0 13)
+(Version-Log "")
+(New-Version-Log "")
+(Checkin-Time "Sun, 15 Mar 1998 17:30:48 +0900")
+(Checkin-Login gniibe)
+(Populate-Ignore ("^.*/RCS/.*$" "^RCS/.*$" "^\\.elc$"))
+(Project-Keywords)
+(Files
+;; Files added by populate at Wed, 18 Feb 1998 10:12:48 +0900:
+ (wnn/zy_table.c (Egg/0_zy_table.c 1.1 644))
+ (wnn/zh_msg (Egg/1_zh_msg 1.1 644))
+ (wnn/yincoding.c (Egg/2_yincoding. 1.1 644))
+ (wnn/xutoj.c (Egg/3_xutoj.c 1.1 644))
+ (wnn/wnnerror.h (Egg/4_wnnerror.h 1.1 644))
+ (wnn/wnnerrmsg.c (Egg/5_wnnerrmsg. 1.1 644))
+ (wnn/wnn_string.h (Egg/6_wnn_string 1.1 644))
+ (wnn/wnn_os.h (Egg/7_wnn_os.h 1.1 644))
+ (wnn/wnn_malloc.h (Egg/8_wnn_malloc 1.1 644))
+ (wnn/structure (Egg/9_structure 1.1 644))
+ (wnn/strings.c.orig (Egg/10_strings.c. 1.1 644))
+ (wnn/strings.c (Egg/11_strings.c 1.1 644))
+ (wnn/sstrings.c (Egg/12_sstrings.c 1.1 644))
+ (wnn/server_env.c (Egg/13_server_env 1.1 644))
+ (wnn/rk_spclval.h (Egg/14_rk_spclval 1.1 644))
+ (wnn/revdic.c (Egg/15_revdic.c 1.1 644))
+ (wnn/py_table.c (Egg/16_py_table.c 1.1 644))
+ (wnn/pwd.c (Egg/17_pwd.c 1.1 644))
+ (wnn/msg.h (Egg/18_msg.h 1.1 644))
+ (wnn/msg.c.orig (Egg/19_msg.c.orig 1.1 644))
+ (wnn/msg.c (Egg/20_msg.c 1.1 644))
+ (wnn/kr_msg (Egg/21_kr_msg 1.1 644))
+ (wnn/kankana.c (Egg/22_kankana.c 1.1 644))
+ (wnn/jslib.h (Egg/23_jslib.h 1.1 644))
+ (wnn/js.c.orig (Egg/24_js.c.orig 1.1 644))
+ (wnn/js.c (Egg/25_js.c 1.1 644))
+ (wnn/jp_msg (Egg/26_jp_msg 1.1 644))
+ (wnn/jllib.h (Egg/27_jllib.h 1.1 644))
+ (wnn/jlib.h (Egg/28_jlib.h 1.1 644))
+ (wnn/jl.c (Egg/29_jl.c 1.1 644))
+ (wnn/jh.h (Egg/30_jh.h 1.1 644))
+ (wnn/jdata.h (Egg/31_jdata.h 1.1 644))
+ (wnn/jd_sock.h (Egg/32_jd_sock.h 1.1 644))
+ (wnn/hinsi_file.h (Egg/33_hinsi_file 1.1 644))
+ (wnn/hinsi.h (Egg/34_hinsi.h 1.1 644))
+ (wnn/hindo.c (Egg/35_hindo.c 1.1 644))
+ (wnn/getopt.c (Egg/36_getopt.c 1.1 644))
+ (wnn/gethinsi.c (Egg/37_gethinsi.c 1.1 644))
+ (wnn/dic_atojis.c (Egg/38_dic_atojis 1.1 644))
+ (wnn/demcom.h (Egg/39_demcom.h 1.1 644))
+ (wnn/cplib.h (Egg/40_cplib.h 1.1 644))
+ (wnn/copyright.h (Egg/41_copyright. 1.1 644))
+ (wnn/config.h (Egg/42_config.h 1.1 644))
+ (wnn/commonhd.h (Egg/43_commonhd.h 1.1 644))
+ (wnn/bdic.c (Egg/44_bdic.c 1.1 644))
+ (wnn/bcopy.c (Egg/45_bcopy.c 1.1 644))
+ (obsolete/w-wnnfns/wnnfns.c (Egg/46_wnnfns.c 1.1 644))
+ (obsolete/w-wnnfns/init-with-wnnfns.el (Egg/47_init-with- 1.1 644))
+ (obsolete/w-wnnfns/Makefile (Egg/48_Makefile 1.1 644))
+ (obsolete/its/zhuyin.el (Egg/49_zhuyin.el 1.1 644))
+ (obsolete/its/zenkaku.el (Egg/50_zenkaku.el 1.1 644))
+ (obsolete/its/pinyin.el (Egg/51_pinyin.el 1.1 644))
+ (obsolete/its/kata.el (Egg/b/0_kata.el 1.1 644))
+ (obsolete/its/kanainput.el (Egg/b/1_kanainput. 1.1 644))
+ (obsolete/its/hira.el (Egg/b/2_hira.el 1.1 644))
+ (obsolete/its/hankaku.el (Egg/b/3_hankaku.el 1.1 644))
+ (obsolete/its/hangul.el (Egg/b/4_hangul.el 1.1 644))
+ (obsolete/its/han-kata.el (Egg/b/5_han-kata.e 1.1 644))
+ (obsolete/wnnfns.h (Egg/b/6_wnnfns.h 1.1 644))
+ (obsolete/wnn6fns.c (Egg/b/7_wnn6fns.c 1.1 644))
+ (obsolete/wnn6.el (Egg/b/8_wnn6.el 1.1 644))
+ (obsolete/wnn-egg.el (Egg/b/9_wnn-egg.el 1.1 644))
+ (obsolete/wnn-egg-msg.el (Egg/b/10_wnn-egg-ms 1.1 644))
+ (obsolete/wnn-egg-misc.el (Egg/b/11_wnn-egg-mi 1.1 644))
+ (obsolete/wnn-egg-dict.el (Egg/b/12_wnn-egg-di 1.1 644))
+ (obsolete/modeline.el (Egg/b/13_modeline.e 1.1 644))
+ (obsolete/mlh-nihongo.el (Egg/b/14_mlh-nihong 1.1 644))
+ (obsolete/init.el (Egg/b/15_init.el 1.1 644))
+ (obsolete/eggrc-wnn6 (Egg/b/16_eggrc-wnn6 1.1 644))
+ (obsolete/eggrc-wnn (Egg/b/17_eggrc-wnn 1.1 644))
+ (obsolete/egg.el (Egg/b/18_egg.el 1.1 644))
+ (obsolete/egg-misc.el (Egg/b/19_egg-misc.e 1.1 644))
+ (obsolete/egg-jsymbol.el (Egg/b/20_egg-jsymbo 1.1 644))
+ (obsolete/egg-henkan.el (Egg/b/21_egg-henkan 1.1 644))
+ (obsolete/egg-fence.el (Egg/b/22_egg-fence. 1.1 644))
+ (obsolete/MEMO (Egg/b/23_MEMO 1.1 644))
+ (obsolete/HISTORY (Egg/b/24_HISTORY 1.1 644))
+ (obsolete/ChangeLog (Egg/b/25_ChangeLog 1.1 644))
+ (its/zhuyin.el (Egg/b/26_zhuyin.el 1.2 644))
+ (its/pinyin.el (Egg/b/27_pinyin.el 1.3 644))
+ (its/kana.el (Egg/b/28_kana.el 1.1 644))
+ (its/hira.el (Egg/b/29_hira.el 1.3 644))
+ (its/hangul.el (Egg/b/30_hangul.el 1.3 644))
+ (its/erpin.el (Egg/b/31_erpin.el 1.2 644))
+ (incoming/utils.el (Egg/b/32_utils.el 1.1 644))
+ (incoming/tamago-cnv.el.diff (Egg/b/33_tamago-cnv 1.1 644))
+ (incoming/jis-input.el (Egg/b/34_jis-input. 1.1 644))
+ (incoming/its-util.el (Egg/b/35_its-util.e 1.1 644))
+ (incoming/its-hangul-test.el (Egg/b/36_its-hangul 1.1 644))
+ (incoming/its-hangul-2.el (Egg/b/37_its-hangul 1.1 644))
+ (incoming/hangul-structure.el (Egg/b/38_hangul-str 1.1 644))
+ (incoming/emacs-bug (Egg/b/39_emacs-bug 1.1 644))
+ (incoming/ccl (Egg/b/40_ccl 1.1 644))
+ (incoming/bushu.el (Egg/b/41_bushu.el 1.1 644))
+ (egg/wnnrpc.el (Egg/b/42_wnnrpc.el 1.2 644))
+ (egg/wnn.el (Egg/b/43_wnn.el 1.4 644))
+ (egg/sj3rpc.el (Egg/b/44_sj3rpc.el 1.4 644))
+ (egg/sj3.el (Egg/b/45_sj3.el 1.5 644))
+ (menudiag.el (Egg/b/46_menudiag.e 1.2 644))
+ (leim-list-egg.el (Egg/b/47_leim-list- 1.5 644))
+ (its.el (Egg/b/48_its.el 1.9 644))
+; (euc-china.el (Egg/b/49_euc-cn.el 1.2 644))
+ (egg.el (Egg/b/50_egg.el 1.5 644))
+ (egg-mlh.el (Egg/b/51_egg-mlh.el 1.5 644))
+ (egg-com.el (Egg/c/0_egg-com.el 1.5 644))
+ (egg-cnv.el (Egg/c/1_egg-cnv.el 1.6 644))
+ (docomp.el (Egg/c/2_docomp.el 1.3 644))
+ (TODO (Egg/c/3_TODO 1.1 644))
+ (README (Egg/c/4_README 1.1 644))
+ (PROBLEMS (Egg/c/5_PROBLEMS 1.1 644))
+ (Makefile (Egg/c/6_Makefile 1.6 644))
+ (ChangeLog (Egg/c/7_ChangeLog 1.13 644))
+ (AUTHORS (Egg/c/8_AUTHORS 1.2 644))
+; (obsolete/its/RCS () :directory)
+; (obsolete/RCS/wnnfns.h,v ())
+; (obsolete/RCS/wnnfns.c,v ())
+; (obsolete/RCS/wnn6fns.c,v ())
+; (obsolete/RCS/wnn-egg.el,v ())
+; (obsolete/RCS/wnn-egg-msg.el,v ())
+; (obsolete/RCS/wnn-egg-misc.el,v ())
+; (obsolete/RCS/wnn-egg-dict.el,v ())
+; (obsolete/RCS/modeline.el,v ())
+; (obsolete/RCS/eggrc-wnn,v ())
+; (obsolete/RCS/eggrc-sj3,v ())
+; (obsolete/RCS/egg-misc.el,v ())
+; (obsolete/RCS/egg-keymap.el,v ())
+; (obsolete/RCS/egg-jsymbol.el,v ())
+; (obsolete/RCS/egg-henkan.el,v ())
+; (obsolete/RCS/egg-fence.el,v ())
+; (obsolete/RCS/diced.el,v ())
+; (RCS/utils.el,v ())
+; (RCS/mlh.el,v ())
+; (RCS/menu.el,v ())
+; (RCS/jis-input.el,v ())
+; (RCS/its.el,v ())
+; (RCS/egg.el,v ())
+; (RCS/busyu.el,v ())
+ (its-keydef.el (Egg/c/9_its-keydef 1.5 644))
+ (incoming/kawabata (Egg/c/10_kawabata 1.1 644))
+;; Files added by populate at Sun, 15 Mar 1998 15:40:35 +0900:
+ (egg-hilit.el (Egg/c/11_egg-hilit. 1.1 644))
+ (its/zenkaku.el (Egg/c/12_zenkaku.el 1.1 644))
+ (its/quanjiao.el (Egg/c/13_quanjiao.e 1.1 644))
+ (its/kata.el (Egg/c/14_kata.el 1.1 644))
+ (its/jeonkak.el (Egg/c/15_jeonkak.el 1.1 644))
+ (its/hankata.el (Egg/c/16_hankata.el 1.1 644))
+ (its/ascii.el (Egg/c/17_ascii.el 1.1 644))
+)
+(Merge-Parents)
+(New-Merge-Parents)
.SUFFIXES: .el .elc
-ETCS = Makefile leim-list-egg.el AUTHORS ChangeLog README TODO docomp.el
+ETCS = Makefile leim-list-egg.el AUTHORS ChangeLog README TODO docomp.el \
+ Egg.prj PROBLEMS
SRCS = menudiag.el its.el egg.el \
+ its/ascii.el \
+ its/erpin.el \
+ its/hankata.el \
its/hira.el \
+ its/jeonkak.el \
its/pinyin.el \
its/hangul.el \
+ its/kata.el \
+ its/quanjiao.el \
+ its/zenkaku.el \
+ its/zhuyin.el \
its-keydef.el \
egg-mlh.el egg-cnv.el egg-com.el \
egg/sj3.el egg/sj3rpc.el \
for x in ${SRCS} ${ELCS}; do $(INSTALL) -m 644 $$x ${SITEDIR}/`dirname $$x`; done
$(INSTALL) -m 644 leim-list.el ${SITEDIR}
+# DEPENDENCIES
egg/sj3rpc.elc: egg-com.elc egg/sj3.elc
egg/wnnrpc.elc: egg-com.elc egg/wnn.elc
+egg.elc its/ascii.elc its/erpin.elc its/hankata.elc \
+ its/hira.elc its/jeonkak.elc its/pinyin.elc \
+ its/hangul.elc its/kata.elc its/quanjiao.elc \
+ its/zenkaku.elc its/zhuyin.elc: its-keydef.elc
+
distclean:
rm -f ${ELCS} leim-list.el *~
--- /dev/null
+* describe-bindings
+
+* C-k (egg-decide-before-point)
+
+* HIRAGANA & KATAKANA candidates
+
)
(require 'cl)
-(require 'its-keydef)
;;; Code:
+(defvar egg-current-language)
+(make-variable-buffer-local 'egg-current-language)
+(put 'egg-current-language 'permanent-local t)
+
(defsubst egg-bunsetsu-info () 'intangible)
(defun egg-get-bunsetsu-info (p)
- (let ((info (get-text-property p (egg-bunsetsu-info))))
- (cond
- ((consp info)
- (setq egg-conversion-backend (car info))
- (cdr info)))))
+ (let ((bunsetsu-info (get-text-property p (egg-bunsetsu-info))))
+ (if bunsetsu-info
+ (setq egg-conversion-backend (get-text-property p 'egg-backend)
+ egg-current-language (get-text-property p 'egg-lang)))
+ 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
+ nil
+
+ egg-fini-other-languages
+ ])
+
+(defun egg-init-other-languages ()
+ )
+
+(defun egg-start-conversion-other-languages (yomi-string language)
+ (list yomi-string))
+(defun egg-get-bunsetsu-converted-other-languages (bunsetsu-info)
+ bunsetsu-info)
+(defun egg-get-bunsetsu-source-other-languages (bunsetsu-info)
+ bunsetsu-info)
+(defun egg-list-candidates-other-languages (bunsetsu-info prev-bunsetsu-info)
+ 1)
+(defun egg-get-number-of-candidates-other-languages (bunsetsu-info)
+ 1)
+(defun egg-get-current-candidate-number-other-languages (bunsetsu-info)
+ 0)
+(defun egg-get-all-candidates-other-languages (bunsetsu-info)
+ (list bunsetsu-info))
+(defun egg-decide-candidate-other-languages (bunsetsu-info candidate-pos)
+ bunsetsu-info)
+(defun egg-change-bunsetsu-length-other-languages (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)
+ nil)
+(defun egg-fini-other-languages (language)
+ nil)
+
(defvar egg-conversion-backend-alist nil)
(make-variable-buffer-local 'egg-conversion-backend-alist)
(defvar egg-conversion-backend nil)
(defvar egg-finalize-backend-alist nil)
(defun egg-set-current-backend (language)
- (let ((backend (assoc lang egg-conversion-backend-alist)))
- (if (null backend)
- (error "%S is not supported" lang)
- (setq egg-conversion-backend (cdr backend)))))
+ (setq egg-conversion-backend
+ (cdr (assoc 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 9) b0 b1 b2 len))
(defun egg-end-conversion (bunsetsu-info-list)
(funcall (aref egg-conversion-backend 10) bunsetsu-info-list))
+(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))
(funcall (car (car (car alist))) (cdr (car (car alist))))
(setq alist (cdr alist)))))
-(defmacro egg-set-conversion-backend-internal (backend langs &optional force)
- `(let ((l ,langs) pair)
- (while l
- (setq pair (assoc (car l) egg-conversion-backend-alist))
- (if (null pair)
- (setq egg-conversion-backend-alist
- (cons (cons (car l) ,backend)
- egg-conversion-backend-alist))
- ,(if force `(setcdr pair ,backend)))
- (setq pair (cons (aref ,backend 11) (car l)))
- (if (null (assoc pair egg-finalize-backend-alist))
- (setq egg-finalize-backend-alist
- (cons (list pair) egg-finalize-backend-alist)))
- (setq l (cdr l)))))
-
-(defun egg-set-conversion-backend (backend curent-langs other-langs)
- (egg-set-conversion-backend-internal backend curent-langs t)
- (egg-set-conversion-backend-internal backend other-langs))
+(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)))))
\f
-(defvar egg-conversion-open "|")
-(defvar egg-conversion-close "|")
+(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)")
+(defvar egg-conversion-face nil "*\e$B%U%'%s%9I=<($KMQ$$$k\e(B face \e$B$^$?$O\e(B nil")
(defvar egg-conversion-separator " ")
+(defun egg-get-conversion-face ()
+ (let ((face (and (listp egg-conversion-face)
+ (or (assoc egg-current-language egg-conversion-face)
+ (assoc t egg-conversion-face)))))
+ (if face (cdr face) egg-conversion-face)))
+
;;
(defun egg-convert-region (start end)
(interactive "r")
- (let (bunsetsu-info-list lang contin p s e)
- (save-restriction
- (narrow-to-region start end)
- (goto-char start)
- (insert egg-conversion-open)
- (add-text-properties start (point)
+ (if (>= start end)
+ ;; nothing to do
+ nil
+ (remove-text-properties start end '(read-only nil intangible nil))
+ (goto-char start)
+ (insert egg-conversion-open)
+ (let ((inhibit-read-only t)
+ (max (make-marker))
+ bunsetsu-info-list contin p s e result)
+ (setq p (+ (point) (- end start)))
+ (set-text-properties start (point)
(list
+ 'read-only t
'egg-start t
- 'egg-source (buffer-substring (point)
- (point-max))))
+ 'egg-source (buffer-substring (point) p)))
(if egg-conversion-face
- (put-text-property start (point) 'invisible t))
+ (put-text-property start (point) 'invisible t))
(setq start (point))
- (egg-separate-languages start (point-max))
+ (goto-char p)
+ (insert egg-conversion-close)
+ (set-text-properties p (point) '(read-only t rear-nonsticky t egg-end t))
+ (if egg-conversion-face
+ (put-text-property p (point) 'invisible t))
+ (set-marker max p)
+ (egg-separate-languages start max)
(goto-char start)
- (while (< (point) (point-max))
- (setq lang (get-text-property (point) 'egg-lang)
+ (while (< (point) max)
+ (setq egg-current-language (get-text-property (point) 'egg-lang)
s (point)
e (point))
- (while (and (< e (point-max))
- (equal lang (get-text-property e 'egg-lang)))
- (setq e (next-single-property-change e 'egg-lang nil (point-max))))
- (setq bunsetsu-info-list
- (egg-start-conversion (buffer-substring s e) lang))
- (setq contin (< e (point-max)))
+ (while (and (< e max)
+ (equal egg-current-language
+ (get-text-property e 'egg-lang)))
+ (setq e (next-single-property-change e 'egg-lang nil max)))
+ (condition-case result
+ (setq bunsetsu-info-list
+ (egg-start-conversion
+ (buffer-substring-no-properties s e)
+ egg-current-language))
+ (error
+ (setq egg-conversion-backend egg-conversion-backend-other-languages
+ bunsetsu-info-list (egg-start-conversion-other-languages
+ (buffer-substring-no-properties s e)
+ egg-current-language))
+ (message "egg %s backend: %s" egg-current-language (cadr result))))
+ (setq contin (< e max))
(delete-region s e)
(egg-insert-bunsetsu-list bunsetsu-info-list
- (if (< (point) (point-max)) 'contine t))))
- (setq p (point))
- (insert egg-conversion-close)
- (put-text-property p (point) 'egg-end t)
- (if egg-conversion-face
- (put-text-property p (point) 'invisible t))
- (goto-char start)))
+ (if (< (point) max) 'contine t)))
+ (set-marker max nil)
+ (goto-char start))))
-(defun egg-separate-languages (start end)
- (let (lang last-lang last-chinese p l c cset)
+(defun egg-separate-languages (start end &optional use-context)
+ (let (lang last-lang last-chinese p pe l c cset)
;; 1st pass -- mark undefined Chinese part
(goto-char start)
+ (and use-context
+ (setq last-lang (get-text-property (1- (point)) 'egg-lang))
+ (or (equal last-lang "Chinese-GB") (equal last-lang "Chinese-CNS"))
+ (setq last-chinese last-lang))
(while (< (point) end)
- (setq p (next-single-property-change (point) 'its-lang nil end))
+ (setq p (point)
+ pe (next-single-property-change (point) 'egg-lang nil end))
(cond
- ((get-text-property (point) 'its-lang)
- (goto-char p))
- ((setq l (egg-chinese-syllable (buffer-substring (point) p)))
- (setq p (point))
- (goto-char (+ (point) l))
- (put-text-property p (point) 'its-lang "Chinese"))
+ ((get-text-property (point) 'egg-lang)
+ (goto-char pe)
+ (setq lang nil))
+ ((setq l (egg-chinese-syllable (buffer-substring p pe)))
+ (goto-char (+ p l))
+ (setq lang "Chinese"))
((progn
(setq c (following-char)
cset (char-charset c))
(eq cset 'chinese-sisheng))
- (setq p (point))
(forward-char)
- (put-text-property p (point) 'its-lang "Chinese"))
+ (setq lang "Chinese"))
((eq cset 'ascii)
- (forward-char))
- (t
- (setq p (point))
+ (skip-chars-forward "\0-\177" pe)
+ (if (eq (char-charset (following-char)) 'chinese-sisheng)
+ (goto-char (max (1+ pp) (- (point) 6))))
+ (setq lang nil))
+ ((eq cset 'composition)
(forward-char)
- (put-text-property p (point) 'its-lang (egg-char-to-language c)))))
+ (setq lang (egg-charset-to-language
+ (char-charset (car (decompose-composite-char c 'list))))))
+ (t
+ (skip-chars-forward (concat (vector (make-char cset 33 33))
+ "-"
+ (vector (make-char cset 127 127)))
+ pe)
+ (setq lang (egg-charset-to-language cset))))
+ (if lang
+ (put-text-property p (point) 'egg-lang lang)))
;; 2nd pass -- set language property
(goto-char start)
(while (< (point) end)
- (setq lang (get-text-property (point) 'its-lang))
+ (setq lang (get-text-property (point) 'egg-lang))
(cond
((null lang)
(setq lang (or last-lang
(if (or (equal lang "Chinese-GB") (equal lang "Chinese-CNS"))
(setq last-chinese lang))
(setq p (point))
- (goto-char (next-single-property-change (point) 'its-lang nil end))
+ (goto-char (next-single-property-change (point) 'egg-lang nil end))
(set-text-properties p (point) (list 'egg-lang lang)))))
-(defun egg-char-to-language (c)
- (let ((charset (char-charset c))
- (list language-info-alist))
+(defun egg-charset-to-language (charset)
+ (let ((list language-info-alist))
(while (and list
(null (memq charset (assq 'charset (car list)))))
(setq list (cdr list)))
(car (car list))))
(defun egg-next-part-lang (end)
- (let* ((p (next-single-property-change (point) 'its-lang nil end))
- (lang (get-text-property p 'its-lang)))
+ (let* ((p (next-single-property-change (point) 'egg-lang nil end))
+ (lang (get-text-property p 'egg-lang)))
(if (equal lang "Chinese")
(egg-next-chinese-lang end)
(or lang
(let (p lang)
(setq p (point))
(while (and (< p end) (null lang))
- (setq p (next-single-property-change p 'its-lang nil end))
- (setq lang (get-text-property p 'its-lang))
+ (setq p (next-single-property-change p 'egg-lang nil end))
+ (setq lang (get-text-property p 'egg-lang))
(if (null (or (equal lang "Chinese-GB")
(equal lang "Chinese-CNS")))
(setq lang nil)))
egg-default-language)
(t "Chinese-GB"))))
\f
-(defvar egg-conversion-face nil)
+(require 'its-keydef)
+
(defvar egg-conversion-map
(let ((map (make-sparse-keymap))
(i 33))
(define-key map "\C-n" 'egg-next-candidate)
(define-key map "\C-o" 'egg-enlarge-bunsetsu)
(define-key map "\C-p" 'egg-previous-candidate)
+ (define-key map "\C-r" 'egg-reverse-convert-bunsetu)
+ (define-key map "\M-r" 'egg-reconvert-bunsetsu)
(define-key map "\M-s" 'egg-select-candidate)
(define-key map [return] 'egg-exit-conversion)
-;; (define-key map "\C-\\" 'egg-exit-mode-no-egg)
(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)
+ (its-define-select-keys map)
map)
"Keymap for EGG Conversion mode.")
(defun egg-insert-bunsetsu (bunsetsu-info last)
(let ((bunsetsu (egg-get-bunsetsu-converted bunsetsu-info))
- (p (point)))
+ (p (point)) p1)
(insert bunsetsu)
+ (setq p1 (point))
(if (null (eq last t))
(insert egg-conversion-separator))
- (add-text-properties p (point)
- (list 'face egg-conversion-face
- 'local-map egg-conversion-map
- (egg-bunsetsu-info) (cons egg-conversion-backend
- bunsetsu-info)
- 'egg-bunsetsu-last last))))
+ (set-text-properties p (point)
+ (list 'read-only t
+ (egg-bunsetsu-info) bunsetsu-info
+ 'egg-backend egg-conversion-backend
+ 'egg-lang egg-current-language
+ 'egg-bunsetsu-last last
+ 'local-map egg-conversion-map))
+ (if egg-conversion-face
+ (put-text-property p p1 'face (egg-get-conversion-face)))))
(defun egg-insert-bunsetsu-list (bunsetsu-info-list &optional last)
(let ((l bunsetsu-info-list)
- bunsetsu-info bunsetsu p)
+ bunsetsu-info)
(while l
(setq bunsetsu-info (car l)
- l (cdr l)
- p (point))
+ l (cdr l))
(egg-insert-bunsetsu bunsetsu-info (and (null l) last)))))
+(defun egg-beginning-of-conversion-buffer (n)
+ (interactive "p")
+ (cond
+ ((<= n 0)
+ (egg-end-of-conversion-buffer 1))
+ ((null (get-text-property (1- (point)) 'egg-start))
+ (goto-char (previous-single-property-change (1- (point)) 'egg-start)))))
+
+(defun egg-end-of-conversion-buffer(n)
+ (interactive "p")
+ (cond
+ ((<= n 0)
+ (egg-beginning-of-conversion-buffer 1))
+ (t
+ (goto-char (next-single-property-change (point) 'egg-end))
+ (backward-char))))
+
(defun egg-backward-bunsetsu (n)
(interactive "p")
(let (start)
(defun egg-enlarge-bunsetsu (n)
(interactive "p")
- (let* ((b0 (egg-get-previous-bunsetsu (point)))
+ (let* ((inhibit-read-only t)
+ (b0 (egg-get-previous-bunsetsu (point)))
(b1 (egg-get-bunsetsu-info (point)))
(s1 (egg-get-bunsetsu-source b1))
(s1len (egg-separate-characters s1))
(defun egg-next-candidate (n)
(interactive "p")
- (let ((last (get-text-property (point) 'egg-bunsetsu-last))
+ (let ((inhibit-read-only t)
+ (last (get-text-property (point) 'egg-bunsetsu-last))
(b (egg-get-bunsetsu-info (point)))
new i max+ p beep)
(setq max+ (egg-get-number-of-candidates b))
(setq max+ (egg-get-number-of-candidates b)))
(setq i (egg-get-current-candidate-number b))
(setq i (+ n i)))
- (if (< i 0) ; go backward as if it is ring
- (while (< i 0)
- (setq i (+ i max+))))
- (if (>= i max+) ; don't go forward
- (setq i (1- max+)
- beep t))
- (setq new (egg-decide-candidate b i))
- (setq p (point))
- (delete-region p (progn (forward-char) (point)))
- (egg-insert-bunsetsu new last)
- (goto-char p)
+ (if (null max+)
+ (setq beep t)
+ (if (< i 0) ; go backward as if it is ring
+ (while (< i 0)
+ (setq i (+ i max+))))
+ (if (>= i max+) ; don't go forward
+ (setq i (1- max+)
+ beep t))
+ (setq new (egg-decide-candidate b i))
+ (setq p (point))
+ (delete-region p (progn (forward-char) (point)))
+ (egg-insert-bunsetsu new last)
+ (goto-char p))
(if beep
(ding))))
(interactive "p")
(egg-next-candidate (- n)))
+(defun egg-reconvert-bunsetsu-internal (n func)
+ (let ((inhibit-read-only t)
+ (p (point))
+ source last bunsetsu-list)
+ (if (<= n 0)
+ (beep)
+ (while (and (null last) (> n 0))
+ (setq source (concat source
+ (egg-get-bunsetsu-converted
+ (egg-get-bunsetsu-info (point))))
+ last (get-text-property (point) 'egg-bunsetsu-last)
+ n (1- n))
+ (forward-char))
+ (cond
+ ((> n 0)
+ (beep))
+ ((setq bunsetsu-list (funcall func source egg-current-language))
+ (delete-region p (point))
+ (egg-insert-bunsetsu-list bunsetsu-list (if (eq last t) t 'contine))
+ (goto-char p)
+ (if (egg-get-previous-bunsetsu p)
+ (progn
+ (backward-char)
+ (put-text-property (point) p 'egg-bunsetsu-last 'contine)
+ (forward-char))))))))
+
+(defun egg-reverse-convert-bunsetu (n)
+ (interactive "p")
+ (egg-reconvert-bunsetsu-internal n 'egg-start-reverse-conversion))
+
+(defun egg-reconvert-bunsetsu (n)
+ (interactive "p")
+ (egg-reconvert-bunsetsu-internal n 'egg-start-conversion))
+
(defun egg-decide-before-point ()
(interactive)
- (let (bunsetsu-list bl (p (point)) source (dlen 0) l s)
+ (let ((inhibit-read-only t)
+ (len (length egg-conversion-open))
+ bunsetsu-list bl (p (point)) source lang s)
(save-restriction
(if (null (get-text-property (1- (point)) 'egg-start))
(goto-char (previous-single-property-change (point) 'egg-start)))
- (narrow-to-region (1- (point)) p)
- (setq source (get-text-property (1- (point)) 'egg-source))
+ (narrow-to-region (- (point) len) p)
(setq bunsetsu-list (setq bl (list nil)))
(while (< (point) (point-max))
;; delete sparator/open marker
- (delete-region (1- (point)) (point))
- (setq bl (setcdr bl (list (egg-get-bunsetsu-info (point)))))
- (setq dlen (+ dlen (length (egg-get-bunsetsu-source (car bl)))))
+ (delete-region (- (point) len) (point))
+ (setq len 1
+ bl (setcdr bl (list (egg-get-bunsetsu-info (point)))))
(if (get-text-property (point) 'egg-bunsetsu-last)
(progn
(egg-end-conversion (cdr bunsetsu-list))
(setq bunsetsu-list (setq bl (list nil)))))
(setq p (point))
(forward-char)
- (remove-text-properties p (point) '(face nil
- intangible nil
- local-map nil
- egg-bunsetsu-last nil))))
+ (set-text-properties p (point) nil)))
+ (if (cdr bunsetsu-list)
+ (egg-end-conversion (cdr bunsetsu-list)))
(if (get-text-property (point) 'egg-end)
(progn
;; delete close marker
- (delete-region (point) (1+ (point)))
+ (delete-region (point) (+ (point) (length egg-conversion-close)))
(egg-do-auto-fill)
(run-hooks 'input-method-after-insert-chunk-hook))
- ;; delete last from speparater to close marker
- (delete-region (1- (point))
- (1+ (next-single-property-change (point) 'egg-end)))
- ;; rebuild fence mode string
- (setq p 0)
- (while (< p dlen)
- (setq s (car (get-text-property p 'its-syl source))
- l (length s)
- p (+ p l))
- (if (> p dlen)
- (put-text-property dlen p
- 'its-syl (list (substring s (- dlen p)))
- source)))
- (its-restart (substring source dlen)))))
+ ;; delete from last speparater
+ (delete-region (1- (point)) (point))
+ (setq source "")
+ (while (null (get-text-property (point) 'egg-end))
+ (setq s (egg-get-bunsetsu-source (egg-get-bunsetsu-info (point))))
+ (put-text-property 0 (length s) 'egg-lang egg-current-language s)
+ (setq source (concat source s))
+ (setq p (point))
+ (forward-char)
+ (delete-region p (point)))
+ ;; delete close marker
+ (delete-region (point) (+ (point) (length egg-conversion-close)))
+ (its-restart source t))))
(defun egg-exit-conversion ()
(interactive)
(defun egg-abort-conversion ()
(interactive)
- (if (null (get-text-property (1- (point)) 'egg-start))
- (goto-char (previous-single-property-change (point) 'egg-start)))
- (egg-decide-before-point))
+ (let ((inhibit-read-only t) source)
+ (goto-char (- (if (get-text-property (1- (point)) 'egg-start)
+ (point)
+ (previous-single-property-change (point) 'egg-start))
+ (length egg-conversion-open)))
+ (setq source (get-text-property (point) 'egg-source))
+ (delete-region (point) (+ (next-single-property-change (point) 'egg-end)
+ (length egg-conversion-close)))
+ (its-restart source)))
(defun egg-select-candidate ()
(interactive)
- (let ((last (get-text-property (point) 'egg-bunsetsu-last))
+ (let ((inhibit-read-only t)
+ (last (get-text-property (point) 'egg-bunsetsu-last))
(b (egg-get-bunsetsu-info (point)))
(in-loop t)
new i max+ p)
(setq i (egg-list-candidates b prev-b))
(setq max+ (egg-get-number-of-candidates b)))
(setq i (egg-get-current-candidate-number b)))
- (let* ((candidate-list (egg-get-all-candidates b))
- (l candidate-list)
- (candidate (menudiag-select (list 'menu "\e$B8uJd\e(B:" l) (list (nth i l)))))
- (setq i 0)
- (while in-loop
- (if (eq candidate (car l))
- (setq in-loop nil)
- (setq l (cdr l)
- i (1+ i))))
- (setq new (egg-decide-candidate b i))
- (setq p (point))
- (delete-region p (progn (forward-char) (point)))
- (egg-insert-bunsetsu new last)
- (goto-char p))))
+ (let (candidate-list candidate l)
+ (if (null max+)
+ ;; fake 1 candidate
+ (menudiag-select (list 'menu "\e$B8uJd\e(B:"
+ (list (egg-get-bunsetsu-converted b))
+ (list (egg-get-bunsetsu-converted b))))
+ (setq candidate-list (egg-get-all-candidates b)
+ l candidate-list
+ candidate (menudiag-select (list 'menu "\e$B8uJd\e(B:" l)
+ (list (nth i l))))
+ (setq i 0)
+ (while in-loop
+ (if (eq candidate (car l))
+ (setq in-loop nil)
+ (setq l (cdr l)
+ i (1+ i))))
+ (setq new (egg-decide-candidate b i))
+ (setq p (point))
+ (delete-region p (progn (forward-char) (point)))
+ (egg-insert-bunsetsu new last)
+ (goto-char p)))))
(provide 'egg-cnv)
;;; egg-cnv.el ends here.
("X" . 20) ("Y" . 21) ("Z" . 22) ("Zh" . 23)))
(defconst yincode-pinyin-yunmu
- '(("\9a À" 0 0) ("\9a À" 0 1) ("\9a À" 0 3) ("\9a À" 0 5) ("\9a À" 0 7)
- ("a\9a À" 1 0) ("\9a ¡\9a À" 1 1) ("\9a ¢\9a À" 1 3) ("\9a £\9a À" 1 5) ("\9a ¤\9a À" 1 7)
- ("ai\9a À" 2 0) ("\9a ¡i\9a À" 2 1) ("\9a ¢i\9a À" 2 3) ("\9a £i\9a À" 2 5) ("\9a ¤i\9a À" 2 7)
- ("an\9a À" 3 0) ("\9a ¡n\9a À" 3 1) ("\9a ¢n\9a À" 3 3) ("\9a £n\9a À" 3 5) ("\9a ¤n\9a À" 3 7)
- ("ang\9a À" 4 0) ("\9a ¡ng\9a À" 4 1) ("\9a ¢ng\9a À" 4 3) ("\9a £ng\9a À" 4 5) ("\9a ¤ng\9a À" 4 7)
- ("ao\9a À" 5 0) ("\9a ¡o\9a À" 5 1) ("\9a ¢o\9a À" 5 3) ("\9a £o\9a À" 5 5) ("\9a ¤o\9a À" 5 7)
- ("e\9a À" 6 0) ("\9a ¥\9a À" 6 1) ("\9a ¦\9a À" 6 3) ("\9a §\9a À" 6 5) ("\9a ¨\9a À" 6 7)
- ("ei\9a À" 7 0) ("\9a ¥i\9a À" 7 1) ("\9a ¦i\9a À" 7 3) ("\9a §i\9a À" 7 5) ("\9a ¨i\9a À" 7 7)
- ("en\9a À" 8 0) ("\9a ¥n\9a À" 8 1) ("\9a ¦n\9a À" 8 3) ("\9a §n\9a À" 8 5) ("\9a ¨n\9a À" 8 7)
- ("eng\9a À" 9 0) ("\9a ¥ng\9a À" 9 1) ("\9a ¦ng\9a À" 9 3) ("\9a §ng\9a À" 9 5) ("\9a ¨ng\9a À" 9 7)
- ("er\9a À" 10 0) ("\9a ¥r\9a À" 10 1) ("\9a ¦r\9a À" 10 3) ("\9a §r\9a À" 10 5) ("\9a ¨r\9a À" 10 7)
- ("i\9a À" 11 0) ("\9a ©\9a À" 11 1) ("\9a ª\9a À" 11 3) ("\9a «\9a À" 11 5) ("\9a ¬\9a À" 11 7)
- ("ia\9a À" 12 0) ("i\9a ¡\9a À" 12 1) ("i\9a ¢\9a À" 12 3) ("i\9a £\9a À" 12 5) ("i\9a ¤\9a À" 12 7)
- ("ian\9a À" 13 0) ("i\9a ¡n\9a À" 13 1) ("i\9a ¢n\9a À" 13 3) ("i\9a £n\9a À" 13 5) ("i\9a ¤n\9a À" 13 7)
- ("iang\9a À" 14 0) ("i\9a ¡ng\9a À" 14 1) ("i\9a ¢ng\9a À" 14 3) ("i\9a £ng\9a À" 14 5) ("i\9a ¤ng\9a À" 14 7)
- ("iao\9a À" 15 0) ("i\9a ¡o\9a À" 15 1) ("i\9a ¢o\9a À" 15 3) ("i\9a £o\9a À" 15 5) ("i\9a ¤o\9a À" 15 7)
- ("ie\9a À" 16 0) ("i\9a ¥\9a À" 16 1) ("i\9a ¦\9a À" 16 3) ("i\9a §\9a À" 16 5) ("i\9a ¨\9a À" 16 7)
- ("in\9a À" 17 0) ("\9a ©n\9a À" 17 1) ("\9a ªn\9a À" 17 3) ("\9a «n\9a À" 17 5) ("\9a ¬n\9a À" 17 7)
- ("ing\9a À" 18 0) ("\9a ©ng\9a À" 18 1) ("\9a ªng\9a À" 18 3) ("\9a «ng\9a À" 18 5) ("\9a ¬ng\9a À" 18 7)
- ("iong\9a À" 19 0) ("i\9a ng\9a À" 19 1) ("i\9a ®ng\9a À" 19 3) ("i\9a ¯ng\9a À" 19 5) ("i\9a °ng\9a À" 19 7)
- ("iu\9a À" 20 0) ("i\9a ±\9a À" 20 1) ("i\9a ²\9a À" 20 3) ("i\9a ³\9a À" 20 5) ("i\9a ´\9a À" 20 7)
- ("m\9a À" 21 0) ("m\9a À" 21 1) ("m\9a À" 21 3) ("m\9a À" 21 5) ("m\9a À" 21 7)
- ("n\9a À" 22 0) ("n\9a À" 22 1) ("\9a ½\9a À" 22 3) ("\9a ¾\9a À" 22 5) ("\9a ¿\9a À" 22 7)
- ("ng\9a À" 23 0) ("ng\9a À" 23 1) ("ng\9a À" 23 3) ("ng\9a À" 23 5) ("ng\9a À" 23 7)
- ("o\9a À" 24 0) ("\9a \9a À" 24 1) ("\9a ®\9a À" 24 3) ("\9a ¯\9a À" 24 5) ("\9a °\9a À" 24 7)
- ("ong\9a À" 25 0) ("\9a ng\9a À" 25 1) ("\9a ®ng\9a À" 25 3) ("\9a ¯ng\9a À" 25 5) ("\9a °ng\9a À" 25 7)
- ("ou\9a À" 26 0) ("\9a u\9a À" 26 1) ("\9a ®u\9a À" 26 3) ("\9a ¯u\9a À" 26 5) ("\9a °u\9a À" 26 7)
- ("u\9a À" 27 0) ("\9a ±\9a À" 27 1) ("\9a ²\9a À" 27 3) ("\9a ³\9a À" 27 5) ("\9a ´\9a À" 27 7)
- ("ua\9a À" 28 0) ("u\9a ¡\9a À" 28 1) ("u\9a ¢\9a À" 28 3) ("u\9a £\9a À" 28 5) ("u\9a ¤\9a À" 28 7)
- ("uai\9a À" 29 0) ("u\9a ¡i\9a À" 29 1) ("u\9a ¢i\9a À" 29 3) ("u\9a £i\9a À" 29 5) ("u\9a ¤i\9a À" 29 7)
- ("uan\9a À" 30 0) ("u\9a ¡n\9a À" 30 1) ("u\9a ¢n\9a À" 30 3) ("u\9a £n\9a À" 30 5) ("u\9a ¤n\9a À" 30 7)
- ("uang\9a À" 31 0) ("u\9a ¡ng\9a À" 31 1) ("u\9a ¢ng\9a À" 31 3) ("u\9a £ng\9a À" 31 5) ("u\9a ¤ng\9a À" 31 7)
- ("ue\9a À" 32 0) ("u\9a ¥\9a À" 32 1) ("u\9a ¦\9a À" 32 3) ("u\9a §\9a À" 32 5) ("u\9a ¨\9a À" 32 7)
- ("ui\9a À" 33 0) ("u\9a ©\9a À" 33 1) ("u\9a ª\9a À" 33 3) ("u\9a «\9a À" 33 5) ("u\9a ¬\9a À" 33 7)
- ("un\9a À" 34 0) ("\9a ±n\9a À" 34 1) ("\9a ²n\9a À" 34 3) ("\9a ³n\9a À" 34 5) ("\9a ´n\9a À" 34 7)
- ("uo\9a À" 35 0) ("u\9a \9a À" 35 1) ("u\9a ®\9a À" 35 3) ("u\9a ¯\9a À" 35 5) ("u\9a °\9a À" 35 7)
- ("\9a ¹\9a À" 36 0) ("\9a µ\9a À" 36 1) ("\9a ¶\9a À" 36 3) ("\9a ·\9a À" 36 5) ("\9a ¸\9a À" 36 7)
- ("\9a ¹e\9a À" 37 0) ("\9a ¹\9a ¥\9a À" 37 1) ("\9a ¹\9a ¦\9a À" 37 3) ("\9a ¹\9a §\9a À" 37 5) ("\9a ¹\9a ¨\9a À" 37 7)
- ("0\9a À" 38 0) ("1\9a À" 38 1) ("2\9a À" 38 3) ("3\9a À" 38 5) ("4\9a À" 38 7)))
+ '(("\e(0@\e(B" 0 0) ("\e(0@\e(B" 0 1) ("\e(0@\e(B" 0 3) ("\e(0@\e(B" 0 5) ("\e(0@\e(B" 0 7)
+ ("a\e(0@\e(B" 1 0) ("\e(0!@\e(B" 1 1) ("\e(0"@\e(B" 1 3) ("\e(0#@\e(B" 1 5) ("\e(0$@\e(B" 1 7)
+ ("ai\e(0@\e(B" 2 0) ("\e(0!\e(Bi\e(0@\e(B" 2 1) ("\e(0"\e(Bi\e(0@\e(B" 2 3) ("\e(0#\e(Bi\e(0@\e(B" 2 5) ("\e(0$\e(Bi\e(0@\e(B" 2 7)
+ ("an\e(0@\e(B" 3 0) ("\e(0!\e(Bn\e(0@\e(B" 3 1) ("\e(0"\e(Bn\e(0@\e(B" 3 3) ("\e(0#\e(Bn\e(0@\e(B" 3 5) ("\e(0$\e(Bn\e(0@\e(B" 3 7)
+ ("ang\e(0@\e(B" 4 0) ("\e(0!\e(Bng\e(0@\e(B" 4 1) ("\e(0"\e(Bng\e(0@\e(B" 4 3) ("\e(0#\e(Bng\e(0@\e(B" 4 5) ("\e(0$\e(Bng\e(0@\e(B" 4 7)
+ ("ao\e(0@\e(B" 5 0) ("\e(0!\e(Bo\e(0@\e(B" 5 1) ("\e(0"\e(Bo\e(0@\e(B" 5 3) ("\e(0#\e(Bo\e(0@\e(B" 5 5) ("\e(0$\e(Bo\e(0@\e(B" 5 7)
+ ("e\e(0@\e(B" 6 0) ("\e(0%@\e(B" 6 1) ("\e(0&@\e(B" 6 3) ("\e(0'@\e(B" 6 5) ("\e(0(@\e(B" 6 7)
+ ("ei\e(0@\e(B" 7 0) ("\e(0%\e(Bi\e(0@\e(B" 7 1) ("\e(0&\e(Bi\e(0@\e(B" 7 3) ("\e(0'\e(Bi\e(0@\e(B" 7 5) ("\e(0(\e(Bi\e(0@\e(B" 7 7)
+ ("en\e(0@\e(B" 8 0) ("\e(0%\e(Bn\e(0@\e(B" 8 1) ("\e(0&\e(Bn\e(0@\e(B" 8 3) ("\e(0'\e(Bn\e(0@\e(B" 8 5) ("\e(0(\e(Bn\e(0@\e(B" 8 7)
+ ("eng\e(0@\e(B" 9 0) ("\e(0%\e(Bng\e(0@\e(B" 9 1) ("\e(0&\e(Bng\e(0@\e(B" 9 3) ("\e(0'\e(Bng\e(0@\e(B" 9 5) ("\e(0(\e(Bng\e(0@\e(B" 9 7)
+ ("er\e(0@\e(B" 10 0) ("\e(0%\e(Br\e(0@\e(B" 10 1) ("\e(0&\e(Br\e(0@\e(B" 10 3) ("\e(0'\e(Br\e(0@\e(B" 10 5) ("\e(0(\e(Br\e(0@\e(B" 10 7)
+ ("i\e(0@\e(B" 11 0) ("\e(0)@\e(B" 11 1) ("\e(0*@\e(B" 11 3) ("\e(0+@\e(B" 11 5) ("\e(0,@\e(B" 11 7)
+ ("ia\e(0@\e(B" 12 0) ("i\e(0!@\e(B" 12 1) ("i\e(0"@\e(B" 12 3) ("i\e(0#@\e(B" 12 5) ("i\e(0$@\e(B" 12 7)
+ ("ian\e(0@\e(B" 13 0) ("i\e(0!\e(Bn\e(0@\e(B" 13 1) ("i\e(0"\e(Bn\e(0@\e(B" 13 3) ("i\e(0#\e(Bn\e(0@\e(B" 13 5) ("i\e(0$\e(Bn\e(0@\e(B" 13 7)
+ ("iang\e(0@\e(B" 14 0) ("i\e(0!\e(Bng\e(0@\e(B" 14 1) ("i\e(0"\e(Bng\e(0@\e(B" 14 3) ("i\e(0#\e(Bng\e(0@\e(B" 14 5) ("i\e(0$\e(Bng\e(0@\e(B" 14 7)
+ ("iao\e(0@\e(B" 15 0) ("i\e(0!\e(Bo\e(0@\e(B" 15 1) ("i\e(0"\e(Bo\e(0@\e(B" 15 3) ("i\e(0#\e(Bo\e(0@\e(B" 15 5) ("i\e(0$\e(Bo\e(0@\e(B" 15 7)
+ ("ie\e(0@\e(B" 16 0) ("i\e(0%@\e(B" 16 1) ("i\e(0&@\e(B" 16 3) ("i\e(0'@\e(B" 16 5) ("i\e(0(@\e(B" 16 7)
+ ("in\e(0@\e(B" 17 0) ("\e(0)\e(Bn\e(0@\e(B" 17 1) ("\e(0*\e(Bn\e(0@\e(B" 17 3) ("\e(0+\e(Bn\e(0@\e(B" 17 5) ("\e(0,\e(Bn\e(0@\e(B" 17 7)
+ ("ing\e(0@\e(B" 18 0) ("\e(0)\e(Bng\e(0@\e(B" 18 1) ("\e(0*\e(Bng\e(0@\e(B" 18 3) ("\e(0+\e(Bng\e(0@\e(B" 18 5) ("\e(0,\e(Bng\e(0@\e(B" 18 7)
+ ("iong\e(0@\e(B" 19 0) ("i\e(0-\e(Bng\e(0@\e(B" 19 1) ("i\e(0.\e(Bng\e(0@\e(B" 19 3) ("i\e(0/\e(Bng\e(0@\e(B" 19 5) ("i\e(00\e(Bng\e(0@\e(B" 19 7)
+ ("iu\e(0@\e(B" 20 0) ("i\e(01@\e(B" 20 1) ("i\e(02@\e(B" 20 3) ("i\e(03@\e(B" 20 5) ("i\e(04@\e(B" 20 7)
+ ("m\e(0@\e(B" 21 0) ("m\e(0@\e(B" 21 1) ("m\e(0@\e(B" 21 3) ("m\e(0@\e(B" 21 5) ("m\e(0@\e(B" 21 7)
+ ("n\e(0@\e(B" 22 0) ("n\e(0@\e(B" 22 1) ("\e(0=@\e(B" 22 3) ("\e(0>@\e(B" 22 5) ("\e(0?@\e(B" 22 7)
+ ("ng\e(0@\e(B" 23 0) ("ng\e(0@\e(B" 23 1) ("ng\e(0@\e(B" 23 3) ("ng\e(0@\e(B" 23 5) ("ng\e(0@\e(B" 23 7)
+ ("o\e(0@\e(B" 24 0) ("\e(0-@\e(B" 24 1) ("\e(0.@\e(B" 24 3) ("\e(0/@\e(B" 24 5) ("\e(00@\e(B" 24 7)
+ ("ong\e(0@\e(B" 25 0) ("\e(0-\e(Bng\e(0@\e(B" 25 1) ("\e(0.\e(Bng\e(0@\e(B" 25 3) ("\e(0/\e(Bng\e(0@\e(B" 25 5) ("\e(00\e(Bng\e(0@\e(B" 25 7)
+ ("ou\e(0@\e(B" 26 0) ("\e(0-\e(Bu\e(0@\e(B" 26 1) ("\e(0.\e(Bu\e(0@\e(B" 26 3) ("\e(0/\e(Bu\e(0@\e(B" 26 5) ("\e(00\e(Bu\e(0@\e(B" 26 7)
+ ("u\e(0@\e(B" 27 0) ("\e(01@\e(B" 27 1) ("\e(02@\e(B" 27 3) ("\e(03@\e(B" 27 5) ("\e(04@\e(B" 27 7)
+ ("ua\e(0@\e(B" 28 0) ("u\e(0!@\e(B" 28 1) ("u\e(0"@\e(B" 28 3) ("u\e(0#@\e(B" 28 5) ("u\e(0$@\e(B" 28 7)
+ ("uai\e(0@\e(B" 29 0) ("u\e(0!\e(Bi\e(0@\e(B" 29 1) ("u\e(0"\e(Bi\e(0@\e(B" 29 3) ("u\e(0#\e(Bi\e(0@\e(B" 29 5) ("u\e(0$\e(Bi\e(0@\e(B" 29 7)
+ ("uan\e(0@\e(B" 30 0) ("u\e(0!\e(Bn\e(0@\e(B" 30 1) ("u\e(0"\e(Bn\e(0@\e(B" 30 3) ("u\e(0#\e(Bn\e(0@\e(B" 30 5) ("u\e(0$\e(Bn\e(0@\e(B" 30 7)
+ ("uang\e(0@\e(B" 31 0) ("u\e(0!\e(Bng\e(0@\e(B" 31 1) ("u\e(0"\e(Bng\e(0@\e(B" 31 3) ("u\e(0#\e(Bng\e(0@\e(B" 31 5) ("u\e(0$\e(Bng\e(0@\e(B" 31 7)
+ ("ue\e(0@\e(B" 32 0) ("u\e(0%@\e(B" 32 1) ("u\e(0&@\e(B" 32 3) ("u\e(0'@\e(B" 32 5) ("u\e(0(@\e(B" 32 7)
+ ("ui\e(0@\e(B" 33 0) ("u\e(0)@\e(B" 33 1) ("u\e(0*@\e(B" 33 3) ("u\e(0+@\e(B" 33 5) ("u\e(0,@\e(B" 33 7)
+ ("un\e(0@\e(B" 34 0) ("\e(01\e(Bn\e(0@\e(B" 34 1) ("\e(02\e(Bn\e(0@\e(B" 34 3) ("\e(03\e(Bn\e(0@\e(B" 34 5) ("\e(04\e(Bn\e(0@\e(B" 34 7)
+ ("uo\e(0@\e(B" 35 0) ("u\e(0-@\e(B" 35 1) ("u\e(0.@\e(B" 35 3) ("u\e(0/@\e(B" 35 5) ("u\e(00@\e(B" 35 7)
+ ("\e(09@\e(B" 36 0) ("\e(05@\e(B" 36 1) ("\e(06@\e(B" 36 3) ("\e(07@\e(B" 36 5) ("\e(08@\e(B" 36 7)
+ ("\e(09\e(Be\e(0@\e(B" 37 0) ("\e(09%@\e(B" 37 1) ("\e(09&@\e(B" 37 3) ("\e(09'@\e(B" 37 5) ("\e(09(@\e(B" 37 7)
+ ("0\e(0@\e(B" 38 0) ("1\e(0@\e(B" 38 1) ("2\e(0@\e(B" 38 3) ("3\e(0@\e(B" 38 5) ("4\e(0@\e(B" 38 7)))
(defconst yincode-pinyin-table
[
])
(defconst yincode-zhuyin-shengmu
- '(("" . 0) ("\9a Å" . 1) ("\9a Ø" . 2) ("\9a Ô" . 3) ("\9a É" . 4)
- ("\9a È" . 5) ("\9a Í" . 6) ("\9a Ï" . 7) ("\9a Ð" . 8) ("\9a Î" . 9)
- ("\9a Ì" . 10) ("\9a Ç" . 11) ("\9a Ë" . 12) ("\9a Æ" . 13) ("\9a Ñ" . 14)
- ("\9a Ö" . 15) ("\9a Ù" . 16) ("\9a Õ" . 17) ("\9a Ê" . 18) ("\9a è" . 19)
- ("\9a Ò" . 20) ("\9a ç" . 21) ("\9a ×" . 22) ("\9a Ó" . 23)))
+ '(("" . 0) ("\e(0E\e(B" . 1) ("\e(0X\e(B" . 2) ("\e(0T\e(B" . 3) ("\e(0I\e(B" . 4)
+ ("\e(0H\e(B" . 5) ("\e(0M\e(B" . 6) ("\e(0O\e(B" . 7) ("\e(0P\e(B" . 8) ("\e(0N\e(B" . 9)
+ ("\e(0L\e(B" . 10) ("\e(0G\e(B" . 11) ("\e(0K\e(B" . 12) ("\e(0F\e(B" . 13) ("\e(0Q\e(B" . 14)
+ ("\e(0V\e(B" . 15) ("\e(0Y\e(B" . 16) ("\e(0U\e(B" . 17) ("\e(0J\e(B" . 18) ("\e(0h\e(B" . 19)
+ ("\e(0R\e(B" . 20) ("\e(0g\e(B" . 21) ("\e(0W\e(B" . 22) ("\e(0S\e(B" . 23)))
(defconst yincode-zhuyin-yunmu
- '(("\9a À" 0 0) ("\9a Á" 0 1) ("\9a Â" 0 3) ("\9a Ã" 0 5) ("\9a Ä" 0 7) ; i
- ("\9a Ú\9a À" 1 0) ("\9a Ú\9a Á" 1 1) ("\9a Ú\9a Â" 1 3) ("\9a Ú\9a Ã" 1 5) ("\9a Ú\9a Ä" 1 7) ; a
- ("\9a Þ\9a À" 2 0) ("\9a Þ\9a Á" 2 1) ("\9a Þ\9a Â" 2 3) ("\9a Þ\9a Ã" 2 5) ("\9a Þ\9a Ä" 2 7) ; ai
- ("\9a â\9a À" 3 0) ("\9a â\9a Á" 3 1) ("\9a â\9a Â" 3 3) ("\9a â\9a Ã" 3 5) ("\9a â\9a Ä" 3 7) ; an
- ("\9a ä\9a À" 4 0) ("\9a ä\9a Á" 4 1) ("\9a ä\9a Â" 4 3) ("\9a ä\9a Ã" 4 5) ("\9a ä\9a Ä" 4 7) ; ang
- ("\9a à\9a À" 5 0) ("\9a à\9a Á" 5 1) ("\9a à\9a Â" 5 3) ("\9a à\9a Ã" 5 5) ("\9a à\9a Ä" 5 7) ; ao
- ("\9a Ü\9a À" 6 0) ("\9a Ü\9a Á" 6 1) ("\9a Ü\9a Â" 6 3) ("\9a Ü\9a Ã" 6 5) ("\9a Ü\9a Ä" 6 7) ; e
- ("\9a ß\9a À" 7 0) ("\9a ß\9a Á" 7 1) ("\9a ß\9a Â" 7 3) ("\9a ß\9a Ã" 7 5) ("\9a ß\9a Ä" 7 7) ; ei
- ("\9a ã\9a À" 8 0) ("\9a ã\9a Á" 8 1) ("\9a ã\9a Â" 8 3) ("\9a ã\9a Ã" 8 5) ("\9a ã\9a Ä" 8 7) ; en
- ("\9a å\9a À" 9 0) ("\9a å\9a Á" 9 1) ("\9a å\9a Â" 9 3) ("\9a å\9a Ã" 9 5) ("\9a å\9a Ä" 9 7) ; eng
- ("\9a æ\9a À" 10 0) ("\9a æ\9a Á" 10 1) ("\9a æ\9a Â" 10 3) ("\9a æ\9a Ã" 10 5) ("\9a æ\9a Ä" 10 7) ; er
- ("\9a ç\9a À" 11 0) ("\9a ç\9a Á" 11 1) ("\9a ç\9a Â" 11 3) ("\9a ç\9a Ã" 11 5) ("\9a ç\9a Ä" 11 7) ; i
- ("\9a ç\9a Ú\9a À" 12 0) ("\9a ç\9a Ú\9a Á" 12 1) ("\9a ç\9a Ú\9a Â" 12 3) ("\9a ç\9a Ú\9a Ã" 12 5) ("\9a ç\9a Ú\9a Ä" 12 7) ; ia
- ("\9a ç\9a â\9a À" 13 0) ("\9a ç\9a â\9a Á" 13 1) ("\9a ç\9a â\9a Â" 13 3) ("\9a ç\9a â\9a Ã" 13 5) ("\9a ç\9a â\9a Ä" 13 7) ; ian
- ("\9a ç\9a ä\9a À" 14 0) ("\9a ç\9a ä\9a Á" 14 1) ("\9a ç\9a ä\9a Â" 14 3) ("\9a ç\9a ä\9a Ã" 14 5) ("\9a ç\9a ä\9a Ä" 14 7) ; iang
- ("\9a ç\9a à\9a À" 15 0) ("\9a ç\9a à\9a Á" 15 1) ("\9a ç\9a à\9a Â" 15 3) ("\9a ç\9a à\9a Ã" 15 5) ("\9a ç\9a à\9a Ä" 15 7) ; iao
- ("\9a ç\9a Ý\9a À" 16 0) ("\9a ç\9a Ý\9a Á" 16 1) ("\9a ç\9a Ý\9a Â" 16 3) ("\9a ç\9a Ý\9a Ã" 16 5) ("\9a ç\9a Ý\9a Ä" 16 7) ; ie
- ("\9a ç\9a ã\9a À" 17 0) ("\9a ç\9a ã\9a Á" 17 1) ("\9a ç\9a ã\9a Â" 17 3) ("\9a ç\9a ã\9a Ã" 17 5) ("\9a ç\9a ã\9a Ä" 17 7) ; in
- ("\9a ç\9a å\9a À" 18 0) ("\9a ç\9a å\9a Á" 18 1) ("\9a ç\9a å\9a Â" 18 3) ("\9a ç\9a å\9a Ã" 18 5) ("\9a ç\9a å\9a Ä" 18 7) ; ing
- ("\9a é\9a å\9a À" 19 0) ("\9a é\9a å\9a Á" 19 1) ("\9a é\9a å\9a Â" 19 3) ("\9a é\9a å\9a Ã" 19 5) ("\9a é\9a å\9a Ä" 19 7) ; iong
- ("\9a ç\9a á\9a À" 20 0) ("\9a ç\9a á\9a Á" 20 1) ("\9a ç\9a á\9a Â" 20 3) ("\9a ç\9a á\9a Ã" 20 5) ("\9a ç\9a á\9a Ä" 20 7) ; iu
- ("\9a Ç\9a À" 21 0) ("\9a Ç\9a Á" 21 1) ("\9a Ç\9a Â" 21 3) ("\9a Ç\9a Ã" 21 5) ("\9a Ç\9a Ä" 21 7) ; m
- ("\9a Ë\9a À" 22 0) ("\9a Ë\9a Á" 22 1) ("\9a Ë\9a Â" 22 3) ("\9a Ë\9a Ã" 22 5) ("\9a Ë\9a Ä" 22 7) ; n
- ("@\9a À" 23 0) ("@\9a Á" 23 1) ("@\9a Â" 23 3) ("@\9a Ã" 23 5) ("@\9a Ä" 23 7) ; ng
- ("\9a Û\9a À" 24 0) ("\9a Û\9a Á" 24 1) ("\9a Û\9a Â" 24 3) ("\9a Û\9a Ã" 24 5) ("\9a Û\9a Ä" 24 7) ; o
- ("\9a è\9a å\9a À" 25 0) ("\9a è\9a å\9a Á" 25 1) ("\9a è\9a å\9a Â" 25 3) ("\9a è\9a å\9a Ã" 25 5) ("\9a è\9a å\9a Ä" 25 7) ; ong
- ("\9a á\9a À" 26 0) ("\9a á\9a Á" 26 1) ("\9a á\9a Â" 26 3) ("\9a á\9a Ã" 26 5) ("\9a á\9a Ä" 26 7) ; ou
- ("\9a è\9a À" 27 0) ("\9a è\9a Á" 27 1) ("\9a è\9a Â" 27 3) ("\9a è\9a Ã" 27 5) ("\9a è\9a Ä" 27 7) ; u
- ("\9a è\9a Ú\9a À" 28 0) ("\9a è\9a Ú\9a Á" 28 1) ("\9a è\9a Ú\9a Â" 28 3) ("\9a è\9a Ú\9a Ã" 28 5) ("\9a è\9a Ú\9a Ä" 28 7) ; ua
- ("\9a è\9a Þ\9a À" 29 0) ("\9a è\9a Þ\9a Á" 29 1) ("\9a è\9a Þ\9a Â" 29 3) ("\9a è\9a Þ\9a Ã" 29 5) ("\9a è\9a Þ\9a Ä" 29 7) ; uai
- ("\9a è\9a â\9a À" 30 0) ("\9a è\9a â\9a Á" 30 1) ("\9a è\9a â\9a Â" 30 3) ("\9a è\9a â\9a Ã" 30 5) ("\9a è\9a â\9a Ä" 30 7) ; uan
- ("\9a è\9a ä\9a À" 31 0) ("\9a è\9a ä\9a Á" 31 1) ("\9a è\9a ä\9a Â" 31 3) ("\9a è\9a ä\9a Ã" 31 5) ("\9a è\9a ä\9a Ä" 31 7) ; uang
- ("\9a é\9a Ý\9a À" 37 0) ("\9a é\9a Ý\9a Á" 37 1) ("\9a é\9a Ý\9a Â" 37 3) ("\9a é\9a Ý\9a Ã" 37 5) ("\9a é\9a Ý\9a Ä" 37 7) ; ue
- ("\9a è\9a ß\9a À" 33 0) ("\9a è\9a ß\9a Á" 33 1) ("\9a è\9a ß\9a Â" 33 3) ("\9a è\9a ß\9a Ã" 33 5) ("\9a è\9a ß\9a Ä" 33 7) ; ui
- ("\9a è\9a ã\9a À" 34 0) ("\9a è\9a ã\9a Á" 34 1) ("\9a è\9a ã\9a Â" 34 3) ("\9a è\9a ã\9a Ã" 34 5) ("\9a è\9a ã\9a Ä" 34 7) ; un
- ("\9a è\9a Û\9a À" 35 0) ("\9a è\9a Û\9a Á" 35 1) ("\9a è\9a Û\9a Â" 35 3) ("\9a è\9a Û\9a Ã" 35 5) ("\9a è\9a Û\9a Ä" 35 7) ; uo
- ("\9a é\9a À" 36 0) ("\9a é\9a Á" 36 1) ("\9a é\9a Â" 36 3) ("\9a é\9a Ã" 36 5) ("\9a é\9a Ä" 36 7) ; \9a ¹
- ("\9a é\9a Ý\9a À" 37 0) ("\9a é\9a Ý\9a Á" 37 1) ("\9a é\9a Ý\9a Â" 37 3) ("\9a é\9a Ý\9a Ã" 37 5) ("\9a é\9a Ý\9a Ä" 37 7) ; \9a ¹e
- ("0\9a À" 38 0) ("1\9a Á" 38 1) ("2\9a Â" 38 3) ("3\9a Ã" 38 5) ("4\9a Ä" 38 7) ; undefined
- ("\9a é\9a â\9a À" 39 0) ("\9a é\9a â\9a Á" 39 1) ("\9a é\9a â\9a Â" 39 3) ("\9a é\9a â\9a Ã" 39 5) ("\9a é\9a â\9a Ä" 39 7) ; \9a ¹an
- ("\9a é\9a ã\9a À" 40 0) ("\9a é\9a ã\9a Á" 40 1) ("\9a é\9a ã\9a Â" 40 3) ("\9a é\9a ã\9a Ã" 40 5) ("\9a é\9a ã\9a Ä" 40 7) ; \9a ¹n
+ '(("\e(0@\e(B" 0 0) ("\e(0A\e(B" 0 1) ("\e(0B\e(B" 0 3) ("\e(0C\e(B" 0 5) ("\e(0D\e(B" 0 7) ; i
+ ("\e(0Z@\e(B" 1 0) ("\e(0ZA\e(B" 1 1) ("\e(0ZB\e(B" 1 3) ("\e(0ZC\e(B" 1 5) ("\e(0ZD\e(B" 1 7) ; a
+ ("\e(0^@\e(B" 2 0) ("\e(0^A\e(B" 2 1) ("\e(0^B\e(B" 2 3) ("\e(0^C\e(B" 2 5) ("\e(0^D\e(B" 2 7) ; ai
+ ("\e(0b@\e(B" 3 0) ("\e(0bA\e(B" 3 1) ("\e(0bB\e(B" 3 3) ("\e(0bC\e(B" 3 5) ("\e(0bD\e(B" 3 7) ; an
+ ("\e(0d@\e(B" 4 0) ("\e(0dA\e(B" 4 1) ("\e(0dB\e(B" 4 3) ("\e(0dC\e(B" 4 5) ("\e(0dD\e(B" 4 7) ; ang
+ ("\e(0`@\e(B" 5 0) ("\e(0`A\e(B" 5 1) ("\e(0`B\e(B" 5 3) ("\e(0`C\e(B" 5 5) ("\e(0`D\e(B" 5 7) ; ao
+ ("\e(0\@\e(B" 6 0) ("\e(0\A\e(B" 6 1) ("\e(0\B\e(B" 6 3) ("\e(0\C\e(B" 6 5) ("\e(0\D\e(B" 6 7) ; e
+ ("\e(0_@\e(B" 7 0) ("\e(0_A\e(B" 7 1) ("\e(0_B\e(B" 7 3) ("\e(0_C\e(B" 7 5) ("\e(0_D\e(B" 7 7) ; ei
+ ("\e(0c@\e(B" 8 0) ("\e(0cA\e(B" 8 1) ("\e(0cB\e(B" 8 3) ("\e(0cC\e(B" 8 5) ("\e(0cD\e(B" 8 7) ; en
+ ("\e(0e@\e(B" 9 0) ("\e(0eA\e(B" 9 1) ("\e(0eB\e(B" 9 3) ("\e(0eC\e(B" 9 5) ("\e(0eD\e(B" 9 7) ; eng
+ ("\e(0f@\e(B" 10 0) ("\e(0fA\e(B" 10 1) ("\e(0fB\e(B" 10 3) ("\e(0fC\e(B" 10 5) ("\e(0fD\e(B" 10 7) ; er
+ ("\e(0g@\e(B" 11 0) ("\e(0gA\e(B" 11 1) ("\e(0gB\e(B" 11 3) ("\e(0gC\e(B" 11 5) ("\e(0gD\e(B" 11 7) ; i
+ ("\e(0gZ@\e(B" 12 0) ("\e(0gZA\e(B" 12 1) ("\e(0gZB\e(B" 12 3) ("\e(0gZC\e(B" 12 5) ("\e(0gZD\e(B" 12 7) ; ia
+ ("\e(0gb@\e(B" 13 0) ("\e(0gbA\e(B" 13 1) ("\e(0gbB\e(B" 13 3) ("\e(0gbC\e(B" 13 5) ("\e(0gbD\e(B" 13 7) ; ian
+ ("\e(0gd@\e(B" 14 0) ("\e(0gdA\e(B" 14 1) ("\e(0gdB\e(B" 14 3) ("\e(0gdC\e(B" 14 5) ("\e(0gdD\e(B" 14 7) ; iang
+ ("\e(0g`@\e(B" 15 0) ("\e(0g`A\e(B" 15 1) ("\e(0g`B\e(B" 15 3) ("\e(0g`C\e(B" 15 5) ("\e(0g`D\e(B" 15 7) ; iao
+ ("\e(0g]@\e(B" 16 0) ("\e(0g]A\e(B" 16 1) ("\e(0g]B\e(B" 16 3) ("\e(0g]C\e(B" 16 5) ("\e(0g]D\e(B" 16 7) ; ie
+ ("\e(0gc@\e(B" 17 0) ("\e(0gcA\e(B" 17 1) ("\e(0gcB\e(B" 17 3) ("\e(0gcC\e(B" 17 5) ("\e(0gcD\e(B" 17 7) ; in
+ ("\e(0ge@\e(B" 18 0) ("\e(0geA\e(B" 18 1) ("\e(0geB\e(B" 18 3) ("\e(0geC\e(B" 18 5) ("\e(0geD\e(B" 18 7) ; ing
+ ("\e(0ie@\e(B" 19 0) ("\e(0ieA\e(B" 19 1) ("\e(0ieB\e(B" 19 3) ("\e(0ieC\e(B" 19 5) ("\e(0ieD\e(B" 19 7) ; iong
+ ("\e(0ga@\e(B" 20 0) ("\e(0gaA\e(B" 20 1) ("\e(0gaB\e(B" 20 3) ("\e(0gaC\e(B" 20 5) ("\e(0gaD\e(B" 20 7) ; iu
+ ("\e(0G@\e(B" 21 0) ("\e(0GA\e(B" 21 1) ("\e(0GB\e(B" 21 3) ("\e(0GC\e(B" 21 5) ("\e(0GD\e(B" 21 7) ; m
+ ("\e(0K@\e(B" 22 0) ("\e(0KA\e(B" 22 1) ("\e(0KB\e(B" 22 3) ("\e(0KC\e(B" 22 5) ("\e(0KD\e(B" 22 7) ; n
+ ("@\e(0@\e(B" 23 0) ("@\e(0A\e(B" 23 1) ("@\e(0B\e(B" 23 3) ("@\e(0C\e(B" 23 5) ("@\e(0D\e(B" 23 7) ; ng
+ ("\e(0[@\e(B" 24 0) ("\e(0[A\e(B" 24 1) ("\e(0[B\e(B" 24 3) ("\e(0[C\e(B" 24 5) ("\e(0[D\e(B" 24 7) ; o
+ ("\e(0he@\e(B" 25 0) ("\e(0heA\e(B" 25 1) ("\e(0heB\e(B" 25 3) ("\e(0heC\e(B" 25 5) ("\e(0heD\e(B" 25 7) ; ong
+ ("\e(0a@\e(B" 26 0) ("\e(0aA\e(B" 26 1) ("\e(0aB\e(B" 26 3) ("\e(0aC\e(B" 26 5) ("\e(0aD\e(B" 26 7) ; ou
+ ("\e(0h@\e(B" 27 0) ("\e(0hA\e(B" 27 1) ("\e(0hB\e(B" 27 3) ("\e(0hC\e(B" 27 5) ("\e(0hD\e(B" 27 7) ; u
+ ("\e(0hZ@\e(B" 28 0) ("\e(0hZA\e(B" 28 1) ("\e(0hZB\e(B" 28 3) ("\e(0hZC\e(B" 28 5) ("\e(0hZD\e(B" 28 7) ; ua
+ ("\e(0h^@\e(B" 29 0) ("\e(0h^A\e(B" 29 1) ("\e(0h^B\e(B" 29 3) ("\e(0h^C\e(B" 29 5) ("\e(0h^D\e(B" 29 7) ; uai
+ ("\e(0hb@\e(B" 30 0) ("\e(0hbA\e(B" 30 1) ("\e(0hbB\e(B" 30 3) ("\e(0hbC\e(B" 30 5) ("\e(0hbD\e(B" 30 7) ; uan
+ ("\e(0hd@\e(B" 31 0) ("\e(0hdA\e(B" 31 1) ("\e(0hdB\e(B" 31 3) ("\e(0hdC\e(B" 31 5) ("\e(0hdD\e(B" 31 7) ; uang
+ ("\e(0i]@\e(B" 37 0) ("\e(0i]A\e(B" 37 1) ("\e(0i]B\e(B" 37 3) ("\e(0i]C\e(B" 37 5) ("\e(0i]D\e(B" 37 7) ; ue
+ ("\e(0h_@\e(B" 33 0) ("\e(0h_A\e(B" 33 1) ("\e(0h_B\e(B" 33 3) ("\e(0h_C\e(B" 33 5) ("\e(0h_D\e(B" 33 7) ; ui
+ ("\e(0hc@\e(B" 34 0) ("\e(0hcA\e(B" 34 1) ("\e(0hcB\e(B" 34 3) ("\e(0hcC\e(B" 34 5) ("\e(0hcD\e(B" 34 7) ; un
+ ("\e(0h[@\e(B" 35 0) ("\e(0h[A\e(B" 35 1) ("\e(0h[B\e(B" 35 3) ("\e(0h[C\e(B" 35 5) ("\e(0h[D\e(B" 35 7) ; uo
+ ("\e(0i@\e(B" 36 0) ("\e(0iA\e(B" 36 1) ("\e(0iB\e(B" 36 3) ("\e(0iC\e(B" 36 5) ("\e(0iD\e(B" 36 7) ; \e(09\e(B
+ ("\e(0i]@\e(B" 37 0) ("\e(0i]A\e(B" 37 1) ("\e(0i]B\e(B" 37 3) ("\e(0i]C\e(B" 37 5) ("\e(0i]D\e(B" 37 7) ; \e(09\e(Be
+ ("0\e(0@\e(B" 38 0) ("1\e(0A\e(B" 38 1) ("2\e(0B\e(B" 38 3) ("3\e(0C\e(B" 38 5) ("4\e(0D\e(B" 38 7) ; undefined
+ ("\e(0ib@\e(B" 39 0) ("\e(0ibA\e(B" 39 1) ("\e(0ibB\e(B" 39 3) ("\e(0ibC\e(B" 39 5) ("\e(0ibD\e(B" 39 7) ; \e(09\e(Ban
+ ("\e(0ic@\e(B" 40 0) ("\e(0icA\e(B" 40 1) ("\e(0icB\e(B" 40 3) ("\e(0icC\e(B" 40 5) ("\e(0icD\e(B" 40 7) ; \e(09\e(Bn
))
(defconst yincode-zhuyin-table
(defun egg-pinyin-syllable (str)
(let (s y end)
- (if (string-match "^[A-Za-z\9a ¡-\9a ¿]+\9a À" str)
+ (if (string-match "^[A-Za-z\e(0!\e(B-\e(0?\e(B]+\e(0@\e(B" str)
(progn
(setq end (match-end 0))
(cond
(defun egg-zhuyin-syllable (str)
(let (end s y c z (zhuyin-len (charset-bytes 'chinese-sisheng)))
- (if (string-match "^[\9a Å-\9a é@0-4]+[\9a À\9a Á\9a Â\9a Ã\9a Ä]" str)
+ (if (string-match "^[\e(0E\e(B-\e(0i\e(B@0-4]+[\e(0@ABCD\e(B]" str)
(progn
(setq end (match-end 0)
c (substring str 0 zhuyin-len)
(defun encode-fixed-euc-china-region (beg end type)
"Encode the text in the region to EUC-CN/TW."
- (let (s syl c cset (maxlen (max (length "Zhu\9a ¡ng\9a À") (length "\9a Ó\9a è\9a ä\9a Á"))))
+ (let (s syl c cset (maxlen (max (length "Zhu\e(0!\e(Bng\e(0@\e(B") (length "\e(0ShdA\e(B"))))
(save-excursion
(save-restriction
(narrow-to-region beg end)
(insert s)
(insert-char 0 1))
+(defsubst comm-format-u8-vector (s)
+ (insert (concat s)))
+
(defsubst comm-format-bytes (s)
(insert s)
(insert-char 255 1))
b means unsigned 8-bit.
S means 16-bit(big endian) wide-character string (0x0000 terminated).
E means multibyte string (0x00 terminated).
-s means 8-bit string (0x00 terminated)."
+s means 8-bit string (0x00 terminated).
+v means 8-bit vector."
(let ((p args) result arg f)
(while format
(setq arg (car p))
(cond ((eq f 'U) (list 'comm-format-u32c arg))
((eq f 'u) (list 'comm-format-u32 arg))
((eq f 'i) (list 'comm-format-i32 arg))
+ ((eq f 'v) (list 'comm-format-u8-vector arg))
((eq f 'w) (list 'comm-format-u16 arg))
((eq f 'b) (list 'comm-format-u8 arg))
((eq f 'S) (list 'comm-format-u16-string arg))
Or else, execute command that space-bar invokes usually."
(interactive)
(let ((henkan-begin nil)
- (inhibit-henkan t))
+ (inhibit-henkan t)
+ (its-disable-special-action t))
(its-select-hiragana) ;; force to Japanese
(mlh-backward-henkan)
(if henkan-begin
(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
(egg-modeless-map)))
(setq inactivate-current-input-method-function 'egg-mode)
(setq describe-current-input-method-function 'egg-help)
- (add-hook 'input-method-activate-hook 'egg-set-mode-line-title)))
-
-(defun egg-set-mode-line-title ()
- (setq current-input-method-title (its-get-indicator its-current-map))
- (force-mode-line-update))
-
-(defun egg-check-language (lang)
- (if (null (member lang egg-support-languages))
- (error "%S is not supported" lang)))
+ (add-hook 'input-method-activate-hook 'its-set-mode-line-title)))
(defun egg-modefull-map ()
"Generate modefull keymap for EGG mode."
;;; egg/sj3.el --- SJ3 Support (high level interface) in Egg
;;; Input Method Architecture
-;; Copyright (C) 1997 Mule Project, Powered by Electrotechnical
-;; Laboratory, JAPAN.
+;; Copyright (C) 1997, 1998 Mule Project,
+;; Powered by Electrotechnical Laboratory, JAPAN.
;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
-;; This file will be part of GNU Emacs (in future).
+;; This file will be part of EGG.
;; EGG is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
(defconst sj3-support-languages '("Japanese"))
+(eval-when-compile
+ (defmacro SJ3-const (c)
+ (cond ((eq c 'FileNotExist) 35)
+ )))
+
(defconst sj3-conversion-backend
[ sj3-init
sj3-decide-candidate
sj3-change-bunsetsu-length
sj3-end-conversion
+ nil
sj3-fini
])
-(defconst sj3-server-port 3000 "Port number of SJ3 server")
+(defvar sj3-server-port 3000 "Port number of SJ3 server")
(defvar sj3-stdy-size 0 "STDYSIZE of SJ3 server")
(defvar sj3-hostname "localhost"
"Hostname of SJ3 server")
+(defvar sj3-open-message)
+
(defun sj3-open (hostname)
"Establish the connection to SJ3 server. Return process object."
(let* ((buf (generate-new-buffer " *SJ3*"))
(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")))))
+
;; <env> ::= [ <proc> <dictionary-list> ]
(defvar sj3-environment nil
"Environment for SJ3 kana-kanji conversion")
;; <bunsetsu> ::=
;; [ <env> <source> <converted> <rest>
-;; <stdy> <zenkouho> <zenkouho-pos> <stdy-down> ]
+;; <stdy> <zenkouho> <zenkouho-pos> <kugiri-changed> ]
(defsubst sj3-make-bunsetsu (env source converted rest stdy)
(vector env source converted rest stdy nil nil nil))
(aref b 6))
(defsubst sj3bunsetsu-set-zenkouho-pos (b p)
(aset b 6 p))
-(defsubst sj3bunsetsu-get-stdydown (b)
+(defsubst sj3bunsetsu-get-kugiri-changed (b)
(aref b 7))
-(defsubst sj3bunsetsu-set-stdydown (b s)
+(defsubst sj3bunsetsu-set-kugiri-changed (b s)
(aset b 7 s))
(defun sj3-get-bunsetsu-source (b)
(t p)))
(defun sj3-get-environment ()
+ "Return the backend of SJ3 environment."
(if sj3-environment
sj3-environment
(let* ((proc (sj3-open sj3-hostname))
- (stdy (sj3-filename (car sj3-dictionary-specification)))
+ (freq-info-name (sj3-filename (car sj3-dictionary-specification)))
(l (cdr sj3-dictionary-specification))
dict-list)
- (if (/= (sj3rpc-open-stdy proc stdy) 0)
- (error "Dame1") ; XXX
- (while l
- (let ((dic (car l))
- dic-id)
- (setq dic-id
- (sj3rpc-open-dictionary proc (sj3-filename (aref dic 0))
- (aref dic 1)))
- (if (< dic-id 0)
- (error "Dame2") ; XXX
- (setq dict-list (cons dic-id dict-list)
- l (cdr l))))))
- (setq sj3-environment (vector proc dict-list)))))
+ (sj3-open-freq-info proc freq-info-name)
+ (while l
+ (let ((dic (car l))
+ dic-id)
+ (setq dic-id
+ (sj3-open-dictionary proc (sj3-filename (aref dic 0))
+ (aref dic 1)))
+ (if (< dic-id 0)
+ (error "Dame2") ; XXX
+ (setq dict-list (cons dic-id dict-list)
+ l (cdr l)))))
+ (setq sj3-environment (vector proc dict-list)))))
+
+(defun sj3-open-freq-info (proc name)
+ (let ((trying t)
+ ret)
+ (while trying
+ (setq ret (sj3rpc-open-stdy proc name))
+ (if (= ret 0)
+ (setq trying nil)
+ (message "\92³Ø\92½¬\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤¬\92¤¢\92¤ê\92¤Þ\92¤»\92¤ó" name)
+ (if (/= ret (SJ3-const FileNotExist))
+ (error "Fatal1") ; XXX
+ (if (and (y-or-n-p
+ (format "\92³Ø\92½¬\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤¬\92¤¢\92¤ê\92¤Þ\92¤»\92¤ó\92¡£\92ºî\92¤ê\92¤Þ\92¤¹\92¤«? "
+ name))
+ (sj3rpc-make-directory proc
+ (file-name-directory name))
+ ;; ignore error
+ (= (sj3rpc-make-stdy proc name) 0))
+ (message "\92³Ø\92½¬\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤ò\92ºî\92¤ê\92¤Þ\92¤·\92¤¿" name)
+ (error "Fatal2"))))))) ; XXX
+
+(defun sj3-open-dictionary (proc name passwd)
+ (let ((trying t)
+ ret)
+ (while trying
+ (setq ret (sj3rpc-open-dictionary proc name passwd))
+ (if (>= ret 0)
+ (setq trying nil)
+ (message "\92¼\92½ñ\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤¬\92¤¢\92¤ê\92¤Þ\92¤»\92¤ó" name)
+ (setq ret (- ret)) ; Get error code.
+ (if (/= ret (SJ3-const FileNotExist))
+ (error "Fatal3 %d" ret) ; XXX
+ (if (and (y-or-n-p
+ (format "\92¼\92½ñ\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤¬\92¤¢\92¤ê\92¤Þ\92¤»\92¤ó\92¡£\92ºî\92¤ê\92¤Þ\92¤¹\92¤«? "
+ name))
+ (= (sj3rpc-make-dictionary proc name) 0))
+ (message "\92¼\92½ñ\92¥Õ\92¥¡\92¥¤\92¥ë(%s)\92¤ò\92ºî\92¤ê\92¤Þ\92¤·\92¤¿" name)
+ (error "Fatal4"))))) ; XXX
+ ret))
(defun sj3-init ()
)
-(defun sj3-start-conversion (yomi lang)
+(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)))
-;; XXX: not implemented yet
(defun sj3-end-conversion (bunsetsu-list)
- )
+ (let ((env (sj3bunsetsu-get-env (car bunsetsu-list)))
+ (l bunsetsu-list)
+ bunsetsu stdy kugiri-changed)
+ (while l
+ (setq bunsetsu (car l))
+ (setq l (cdr l))
+ (setq stdy (sj3bunsetsu-get-stdy bunsetsu))
+ (if stdy
+ (sj3rpc-bunsetsu-stdy env stdy))
+ (if (setq kugiri-changed (sj3bunsetsu-get-kugiri-changed bunsetsu))
+ (let ((yomi1 (sj3bunsetsu-get-source bunsetsu))
+ (yomi2 (sj3bunsetsu-get-source (car l))))
+ (if (/= kugiri-changed (length yomi1))
+ (sj3rpc-kugiri-stdy env yomi1 yomi2
+ (sj3bunsetsu-get-stdy (car l)))))))))
(defun sj3-list-candidates (bunsetsu prev-bunsetsu)
(let* ((env (sj3bunsetsu-get-env bunsetsu))
yomi2 (substring yomi len))
(setq bunsetsu1
(sj3rpc-tanbunsetsu-conversion env yomi1))
- ;; Only set once.
- (sj3bunsetsu-set-stdydown bunsetsu1
- (or (sj3bunsetsu-get-stdydown b1)
- (if b2
- (list b1 b2)
- (list b1))))
+ ;; Only set once (memory original length of the bunsetsu).
+ (sj3bunsetsu-set-kugiri-changed bunsetsu1
+ (or (sj3bunsetsu-get-kugiri-changed b1)
+ (length (sj3bunsetsu-get-source b1))))
(if (< 0 (length yomi2))
(setq bunsetsu2 (sj3rpc-tanbunsetsu-conversion env yomi2))
(setq bunsetsu2 nil))
(list bunsetsu1 bunsetsu2)
(list bunsetsu1))))
-;; XXX: Not implemented yet
(defun sj3-fini (lang)
- )
+ (let ((proc (sj3env-get-proc sj3-environment))
+ (dict-list (sj3env-get-dictionary-list sj3-environment))
+ dict)
+ (while dict-list
+ (setq dict (car dict-list))
+ (setq dict-list (cdr dict-list))
+ (sj3rpc-close-dictionary proc dict)) ; XXX: check error
+ (sj3rpc-close-stdy proc)
+ (sj3rpc-close proc))
+ (setq sj3-environment nil))
;;; setup
"Activate SJ3 backend of Tamagotchy."
(egg-set-support-languages sj3-support-languages)
(egg-set-conversion-backend sj3-conversion-backend
- sj3-support-languages
- nil)
+ sj3-support-languages)
(apply 'egg-mode arg))
;;; egg/sj3.el ends here.
-;;; egg/sj3.el --- SJ3 Support (low level interface) in Egg
-;;; Input Method Architecture
+;;; egg/sj3rpc.el --- SJ3 Support (low level interface) in Egg
+;;; Input Method Architecture
-;; Copyright (C) 1997 Mule Project, Powered by Electrotechnical
-;; Laboratory, JAPAN.
+;; Copyright (C) 1997, 1998 Mule Project,
+;; Powered by Electrotechnical Laboratory, JAPAN.
;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
-;; This file will be part of GNU Emacs (in future).
+;; This file will be part of EGG.
;; EGG is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
((eq c 'KOUHOSU) 55)
((eq c 'KOUHOSU_EUC) 116)
((eq c 'STDY) 61)
- ((eq c 'END) 62)
- ((eq c 'END_EUC) 117)
+ ((eq c 'CLSTDY) 62)
+ ((eq c 'CLSTDY_EUC) 117)
((eq c 'WREG) 71)
((eq c 'WREG_EUC) 118)
((eq c 'WDEL) 72)
((eq c 'VERSION) 103)
(t (error "No such constant")))))
+;; XXX
+(defconst sj3rpc-error-message (vector ))
+
(defun sj3rpc-get-error-message (errno)
- (or (aref sj3rpc-error-message errno) (format "#%d" errno)))
+ (or (and (>= errno 0)
+ (< errno (length sj3rpc-error-message))
+ (aref sj3rpc-error-message errno))
+ (format "#%d" errno)))
(defmacro sj3rpc-call-with-environment (e vlist send-expr &rest receive-exprs)
(let ((v (append
0
result)))
+(defun sj3rpc-close (proc)
+ (comm-call-with-proc proc (result)
+ (comm-format (u) (sj3-const CLOSE))
+ (comm-unpack (u) result)
+ result))
+
(defun sj3rpc-get-stdy-size (proc)
"Return STDYSIZE of SJ3 server. On failure, return error code."
(comm-call-with-proc proc (result)
2048 ; Index length
2048 ; Length
256 ; Number
+ )
(comm-unpack (u) result)
- result)))
+ result))
(defun sj3rpc-open-stdy (proc stdy-name)
(comm-call-with-proc proc (result)
(defun sj3rpc-make-stdy (proc stdy-name)
(comm-call-with-proc proc (result)
- (comm-format (u) (sj3-const MKSTDY) stdy-name "")
+ (comm-format (u s u u u) (sj3-const MKSTDY) stdy-name
2048 ; Number
1 ; Step
2048 ; Length
+ )
+ (comm-unpack (u) result)
+ result))
+
+(defun sj3rpc-make-directory (proc name)
+ (comm-call-with-proc proc (result)
+ (comm-format (u s) (sj3-const MKDIR) name)
(comm-unpack (u) result)
result))
(setq bl (setcdr bl (cons bunsetsu nil)))
(setq bunsetsu-list (setq bl (cons bunsetsu nil))))
(setq i (1+ i)))
+ (setq bunsetsu (sj3-make-bunsetsu env yomi yomi nil nil))
+ (setq bl (setcdr bl (cons bunsetsu nil)))
+ (setq bunsetsu
+ (sj3-make-bunsetsu env yomi (japanese-katakana yomi) nil nil))
+ (setq bl (setcdr bl (cons bunsetsu nil)))
bunsetsu-list))))
(defun sj3rpc-get-bunsetsu-candidates (env yomi)
(substring yomi-ext cylen) 'euc-japan))
(setq bunsetsu (sj3-make-bunsetsu env yomi converted rest stdy))))))
+(defun sj3rpc-bunsetsu-stdy (env stdy)
+ (sj3rpc-call-with-environment env (result)
+ (comm-format (u v) (sj3-const STDY) stdy)
+ (comm-unpack (u) result)
+ (if (/= result 0)
+ (- result)
+ 0)))
+
+(defun sj3rpc-kugiri-stdy (env yomi1 yomi2 stdy)
+ (let* ((yomi1-ext (encode-coding-string yomi1 'euc-japan))
+ (yomi2-ext (encode-coding-string yomi2 'euc-japan)))
+ (sj3rpc-call-with-environment env (result)
+ (comm-format (u s s v) (sj3-const CLSTDY_EUC) yomi1-ext yomi2-ext stdy)
+ (comm-unpack (u) result)
+ (if (/= result 0)
+ (- result)
+ 0))))
+
;;; egg/sj3rpc.el ends here.
wnn-decide-candidate
wnn-change-bunsetsu-length
wnn-end-conversion
+ wnn-start-reverse-conversion
wnn-fini
])
(defvar wnn-environments nil
"Environment for WNN kana-kanji conversion")
-(defcustom wnn-jserver "localhost" "jserver host" :group 'wnn :type 'string)
-(defcustom wnn-cserver "localhost" "cserver host" :group 'wnn :type 'string)
-(defcustom wnn-tserver "localhost" "tserver host" :group 'wnn :type 'string)
-(defcustom wnn-kserver "localhost" "kserver host" :group 'wnn :type 'string)
+(defcustom wnn-jserver nil "jserver host list" :group 'wnn :type 'string)
+(defcustom wnn-cserver nil "cserver host list" :group 'wnn :type 'string)
+(defcustom wnn-tserver nil "tserver host list" :group 'wnn :type 'string)
+(defcustom wnn-kserver nil "kserver host list" :group 'wnn :type 'string)
+
+(defcustom wnn-jport 22273 "jserver port number" :group 'wnn :type 'integer)
+(defcustom wnn-cport 22289 "cserver port number" :group 'wnn :type 'integer)
+(defcustom wnn-tport 22321 "tserver port number" :group 'wnn :type 'integer)
+(defcustom wnn-kport 22305 "kserver port number" :group 'wnn :type 'integer)
;; The port number should be initialized from $WNNLIB/serverdefs by wnn-init
(defconst wnn-server-info-list
- ;; language locale server port stream coding-system hostname
- '(("Japanese" "ja_JP" jserver 22273 "Wnn" fixed-euc-jp wnn-jserver)
- ("Chinese-GB" "zh_CN" cserver 22289 "cWnn" fixed-euc-cn wnn-cserver)
- ("Chinese-CNS" "zh_TW" tserver 22321 "tWnn" fixed-euc-tw wnn-tserver)
- ("Korean" "ko_KR" kserver 22305 "kWnn" fixed-euc-kr wnn-kserver)))
+ ;; language locale server port stream coding-system hostname
+ '(("Japanese" "ja_JP" jserver wnn-jport "Wnn" fixed-euc-jp wnn-jserver)
+ ("Chinese-GB" "zh_CN" cserver wnn-cport "cWnn" fixed-euc-cn wnn-cserver)
+ ("Chinese-CNS" "zh_TW" tserver wnn-tport "tWnn" fixed-euc-tw wnn-tserver)
+ ("Korean" "ko_KR" kserver wnn-kport "kWnn" fixed-euc-kr wnn-kserver)))
(defun wnn-get-server-info (lang)
(let (info)
(nth 2 info))
(defsubst wnn-server-port (info)
- (nth 3 info))
+ (symbol-value (nth 3 info)))
(defsubst wnn-server-stream-name (info)
(nth 4 info))
(wnnenv-set-daibunsetsu-info env (car result))
(cdr result)))
+(defun wnn-start-reverse-conversion (yomi &optional language dic-set)
+ (wnn-start-conversion yomi language dic-set t))
+
(defun wnn-get-bunsetsu-converted (bunsetsu)
(concat (wnn-bunsetsu-get-converted bunsetsu)
(wnn-bunsetsu-get-fuzokugo bunsetsu)))
l (cdr l))))))
;;
+(defvar wnn-open-message)
+
(defun wnn-open (server-info)
"Establish the connection to WNN server. Return process object."
;; Open the session to WNN server,
(let ((buf (generate-new-buffer (wnn-server-buffer-name server-info)))
- (hostname (wnn-server-hostname server-info))
- proc result)
- (condition-case result
- (setq proc (open-network-stream (wnn-server-stream-name server-info)
- buf
- hostname
- (wnn-server-port server-info)))
- (error (progn
- (kill-buffer buf)
- (signal (car result) (cdr result)))))
- (process-kill-without-query proc)
- (set-process-coding-system proc 'no-conversion 'no-conversion)
- (set-process-sentinel proc 'wnn-comm-sentinel)
- (set-marker-insertion-type (process-mark proc) t)
+ (server-type (wnn-server-type server-info))
+ (hostname-list (wnn-server-hostname server-info))
+ (msg-form "WNN: connecting to %S at %s...")
+ hostname proc result msg)
(save-excursion
(set-buffer buf)
(erase-buffer)
(buffer-disable-undo)
(setq enable-multibyte-characters nil
egg-fixed-euc (wnn-server-coding-system server-info)))
- (setq result (wnnrpc-open proc
- (if (equal hostname "localhost")
- "unix"
- (system-name))
- (user-login-name)))
- (if (< result 0)
- (let ((msg (wnnrpc-get-error-message (- result))))
- (delete-process proc)
- (kill-buffer buf)
- (error "Can't open WNN session (%s %S): %s"
- hostname
- (wnn-server-type server-info) msg))
- proc)))
+ (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 server-type hostname)
+ (sit-for 0)
+ (condition-case result
+ (setq proc (open-network-stream (wnn-server-stream-name server-info)
+ buf
+ hostname
+ (wnn-server-port server-info)))
+ (error nil))
+ (if proc
+ (progn
+ (process-kill-without-query proc)
+ (set-process-coding-system proc 'no-conversion 'no-conversion)
+ (set-process-sentinel proc 'wnn-comm-sentinel)
+ (set-marker-insertion-type (process-mark proc) t)
+ (setq result (wnnrpc-open proc
+ (if (equal hostname "localhost")
+ "unix"
+ (system-name))
+ (user-login-name)))
+ (if (< result 0)
+ (progn
+ (delete-process proc)
+ (setq proc nil
+ msg (format "Can't open WNN session (%s %S): %s"
+ hostname
+ (wnn-server-type server-info)
+ msg)))))))
+ (if proc
+ (progn
+ (setq wnn-open-message (format (concat msg-form "done")
+ server-type
+ hostname))
+ proc)
+ (kill-buffer buf)
+ (error "%s" (or msg (format "no %S available" server-type))))))
(defvar wnn-dictionary-specification-list
'((jserver
(eq (wnn-dic-spec-reverse s) reverse))
(setq env e))
(setq spec (cdr spec)))
+ (if (null env)
+ (error "WNN: environment for %S%s (%s) not found"
+ server-type
+ (if dic-set (format "(%S)" dic-set) "")
+ (if reverse 'reverse 'normal)))
+ (message "%s" wnn-open-message)
env)))
(defun wnn-create-environment (proc server-type spec)
"Activate Wnn backend of Tamagotchy."
(egg-set-support-languages wnn-support-languages)
(egg-set-conversion-backend wnn-conversion-backend
- (list (nth 2 arg))
wnn-support-languages)
(apply 'egg-mode arg))
(eval-when-compile
(require 'cl))
-(defvar its-current-language "Japanese")
-
(defvar its-zhuyin nil)
(make-variable-buffer-local 'its-zhuyin)
+(put 'its-zhuyin 'permanent-local t)
(eval-when (eval compile)
-(defun its-make-select-func (key1 key2 name file map &optional lang zhuyin)
- (setq name (intern (concat "its-select-" (symbol-name name)))
- file (intern (concat "its/" (symbol-name file)))
- map (intern (concat "its-" (symbol-name map) "-map"))
- lang (symbol-name lang))
- (cons
- `(defun ,name (&optional mode-line-unchange)
- (interactive)
- (cond
- ((its-in-fence-p)
- (its-input-end)
- (its-put-cursor t))
- ((egg-get-bunsetsu-info (point))
- (egg-exit-conversion)))
- ,(if lang `(egg-check-language ,lang))
- (require ',file)
- (setq its-current-map ,map)
- ,(if lang `(setq its-current-language ,lang))
- ,(if zhuyin `(setq its-zhuyin ,(eq zhuyin 'T)))
- (if (null mode-line-unchange)
- (egg-set-mode-line-title)))
- `(define-key map
- (if fence
- ,(concat "\e" (vector key2))
- ,(concat "\C-x\C-m" (vector key1)))
- ',name)))
-)
+ (defun its-make-select-func (key1 key2 func file map &optional zhuyin)
+ (setq func (intern (concat "its-select-" (symbol-name func)))
+ file (intern (concat "its/" (symbol-name file)))
+ map (intern (concat "its-" (symbol-name map) "-map")))
+ (cons
+ `(defun ,func (&optional temporally mode-line-unchange)
+ (interactive "P")
+ (if temporally
+ (its-select-mode-temporally ',func)
+ (let ((inhibit-read-only t))
+ (require ',file)
+ (cond
+ ((its-in-fence-p)
+ (its-input-end)
+ (its-put-cursor t))
+ ((egg-get-bunsetsu-info (point))
+ (egg-exit-conversion)))
+ (setq its-current-select-func ',func)
+ (setq its-current-map ,map)
+ (if (its-get-language its-current-map)
+ (setq its-current-language (its-get-language its-current-map)))
+ ,(if zhuyin `(setq its-zhuyin ,(eq zhuyin 'T)))
+ (if (null mode-line-unchange)
+ (its-set-mode-line-title)))))
+ `(define-key map
+ (if fence
+ ,(concat "\e" key2)
+ ,(concat "\C-x\C-m" key1))
+ ',func))))
(defmacro its-do-list-make-select-func (list)
(eval-when (eval compile)
,@keydefs)))))
(its-do-list-make-select-func
- ((?Q ?Q upcase ascii up)
- (?q ?q downcase ascii down)
- (?h ?\C-h hiragana hira hira Japanese)
- (?k ?\C-k katakana kata kata Japanese)
- (?x ?\C-x hankaku-katakana hankata han-kata Japanese)
- (?Z ?Z zenkaku-upcase zenkaku zenkaku-up Japanese)
- (?z ?z zenkaku-downcase zenkaku zenkaku-down Japanese)
- (?\C-e ?\C-e erpin-cn erpin erpin-cn Chinese-GB NIL)
- (?\C-p ?\C-p pinyin-cn pinyin pinyin-cn Chinese-GB NIL)
- (?\C-z ?\C-z zhuyin-cn zhuyin zhuyin-cn Chinese-GB T)
- (?\C-u ?\C-u quanjiao-upcase-cn quanjiao quanjiao-up-cn Chinese-GB)
- (?\C-d ?\C-d quanjiao-downcase-cn quanjiao quanjiao-down-cn Chinese-GB)
- (?E ?E erpin-tw erpin erpin-tw Chinese-CNS NIL)
- (?P ?P pinyin-tw pinyin pinyin-tw Chinese-CNS NIL)
- (?Z ?Z zhuyin-tw zhuyin zhuyin-tw Chinese-CNS T)
- (?U ?U quanjiao-upcase-tw quanjiao quanjiao-up-tw Chinese-CNS)
- (?C ?C quanjiao-downcase-tw quanjiao quanjiao-down-tw Chinese-CNS)
- (?H ?H hangul hangul hangul Korean)
- (?J ?J jeonkak-upcase jeonkak jeonkak-up Korean)
- (?j ?j jeonkak-downcase jeonkak jeonkak-down Korean)))
+ (("Q" "Q" upcase ascii up)
+ ("q" "q" downcase ascii down)
+ ("h" "\C-h" hiragana hira hira)
+ ("k" "\C-k" katakana kata kata)
+ ("x" "\C-x" hankaku-katakana hankata han-kata)
+ ("Z" "Z" zenkaku-upcase zenkaku zenkaku-up)
+ ("z" "z" zenkaku-downcase zenkaku zenkaku-down)
+ ("\C-e" "\C-e" erpin-cn erpin erpin-cn NIL)
+ ("\C-p" "\C-p" pinyin-cn pinyin pinyin-cn NIL)
+ ("\C-z" "\C-z" zhuyin-cn zhuyin zhuyin-cn T)
+ ("\C-u" "\C-u" quanjiao-upcase-cn quanjiao quanjiao-up-cn)
+ ("\C-d" "\C-d" quanjiao-downcase-cn quanjiao quanjiao-down-cn)
+ ("E" "E" erpin-tw erpin erpin-tw NIL)
+ ("P" "P" pinyin-tw pinyin pinyin-tw NIL)
+ ("C" "C" zhuyin-tw zhuyin zhuyin-tw T)
+ ("U" "U" quanjiao-upcase-tw quanjiao quanjiao-up-tw)
+ ("D" "D" quanjiao-downcase-tw quanjiao quanjiao-down-tw)
+ ("H" "H" hangul hangul hangul)
+ ("J" "J" jeonkak-upcase jeonkak jeonkak-up)
+ ("j" "j" jeonkak-downcase jeonkak jeonkak-down)))
(provide 'its-keydef)
(require 'cl)
+(defvar its-current-map nil)
+(make-variable-buffer-local 'its-current-map)
+(put 'its-current-map 'permanent-local t)
+
+(defvar its-current-select-func nil)
+(make-variable-buffer-local 'its-current-select-func)
+(put 'its-current-select-func 'permanent-local t)
+
+(defvar its-previous-select-func nil)
+(make-variable-buffer-local 'its-previous-select-func)
+(put 'its-previous-select-func 'permanent-local t)
+
(defvar its-current-language)
(make-variable-buffer-local 'its-current-language)
+(put 'its-current-language 'permanent-local t)
\f
;; Data structure in ITS
;; (1) SYL and CURSOR
;;
;;
-(require 'its-keydef)
+(eval-when (eval load compile)
+ (require 'its-keydef))
(defvar its-mode-map
(let ((map (make-sparse-keymap))
(i 33))
(define-key map "\C-a" 'its-beginning-of-input-buffer)
(define-key map "\C-b" 'its-backward-SYL)
+ (define-key map "\C-c" 'its-cancel-input)
(define-key map "\C-d" 'its-delete-SYL)
(define-key map "\C-e" 'its-end-of-input-buffer)
(define-key map "\C-f" 'its-forward-SYL)
+ (define-key map "\C-g" 'its-select-previous-mode)
(define-key map "\C-]" 'its-cancel-input)
(define-key map "\C-h" 'its-mode-help-command)
(define-key map "\C-k" 'its-kill-line)
(define-key map "\C-m" 'its-exit-mode) ; RET
(define-key map [return] 'its-exit-mode)
(define-key map "\C-t" 'its-transpose-chars)
+ (define-key map "\C-w" 'its-kick-convert-region)
+ (define-key map "\C-y" 'its-yank)
+ (define-key map "\M-y" 'its-yank-pop)
(define-key map [backspace] 'its-delete-backward-SYL)
(define-key map [delete] 'its-delete-backward-SYL)
(define-key map [M-backspace] 'its-delete-backward-SYL-by-keystroke)
(define-key map [M-delete] 'its-delete-backward-SYL-by-keystroke)
(define-key map [right] 'its-forward-SYL)
(define-key map [left] 'its-backward-SYL)
- (define-key map "\C-\\" 'its-exit-mode-off-input-method)
(while (< i 127)
(define-key map (vector i) 'its-self-insert-char)
(setq i (1+ i)))
- (define-key map " " 'its-kick-convert-region)
+ (define-key map " " 'its-kick-convert-region-or-self-insert)
(define-key map "\177" 'its-delete-backward-SYL)
;;
(define-key map "\M-p" 'its-previous-map)
map)
"Keymap for ITS mode.")
-(defvar its-fence-open "|" "*\e$B%U%'%s%9$N;OE@$r<($9J8;zNs\e(B (1 \e$BJ8;z\e(B)")
-(defvar its-fence-close "|" "*\e$B%U%'%s%9$N=*E@$r<($9J8;zNs\e(B (1 \e$BJ8;z\e(B)")
-(defvar its-fence-face nil "*\e$B%U%'%s%9I=<($KMQ$$$k\e(B face \e$B$^$?$O\e(B nil")
+(defvar its-fence-open "|" "*\e$B%U%'%s%9$N;OE@$r<($9J8;zNs\e(B (1 \e$BJ8;z0J>e\e(B)")
+(defvar its-fence-close "|" "*\e$B%U%'%s%9$N=*E@$r<($9J8;zNs\e(B (1 \e$BJ8;z0J>e\e(B)")
+(defvar its-fence-face nil "*\e$B%U%'%s%9I=<($KMQ$$$k\e(B face \e$B$^$?$O\e(B nil")
(defconst its-setup-fence-before-insert-SYL nil)
+(defun its-get-fence-face ()
+ (let ((face (and (consp its-fence-face)
+ (or (assoc its-current-language its-fence-face)
+ (assoc t its-fence-face)))))
+ (if face (cdr face) its-fence-face)))
+
(defun its-put-cursor (cursor)
(let ((p (point))
(map (copy-keymap its-mode-map)))
(its-define-select-keys map)
(insert "!")
(add-text-properties p (point) (list 'local-map map
+ 'read-only t
'invisible t
'intangible 'its-part-2
'its-cursor cursor))
;;
(defun its-setup-fence-mode ()
(let ((open-props '(its-start t intangible its-part-1))
- (close-props '(its-end t intangible its-part-2))
+ (close-props '(rear-nonsticky t its-end t intangible its-part-2))
(p (point)) p1)
+ ;; Put open-fence before inhibit-read-only to detect read-nly
(insert its-fence-open)
- (setq p1 (point))
- (add-text-properties p p1 open-props)
- (insert its-fence-close)
- (add-text-properties p1 (point) close-props)
- (if its-fence-face
- (put-text-property 'invisible t p (point)))
- (goto-char p1)
- (its-put-cursor t)))
+ (let ((inhibit-read-only t))
+ (setq p1 (point))
+ (add-text-properties p p1 open-props)
+ (insert its-fence-close)
+ (add-text-properties p1 (point) close-props)
+ (if its-fence-face
+ (put-text-property p (point) 'invisible t))
+ (put-text-property p (point) 'read-only t)
+ (goto-char p1)
+ (its-put-cursor t))))
(defun its-start (key)
(let ((its-setup-fence-before-insert-SYL t))
- (its-input nil key)
- (force-mode-line-update)))
+ (its-input nil key)))
-(defun its-restart (str)
+(defun its-restart (str &optional set-prop)
(let (p)
(its-setup-fence-mode)
(setq p (point))
(insert str)
+ (if set-prop
+ (its-setup-yanked-portion p (point)))
(its-beginning-of-input-buffer)))
(defun its-self-insert-char ()
(interactive)
- (let ((key last-command-char)
+ (let ((inhibit-read-only t)
+ (key last-command-char)
(cursor (get-text-property (point) 'its-cursor))
(syl (get-text-property (1- (point)) 'its-syl)))
(cond
(setq syl nil)))
(its-input syl key)))
-(defvar its-current-map nil)
-(make-variable-buffer-local 'its-current-map)
-(put 'its-current-map 'permanent-local t)
-
(defun its-initial-ISYL ()
(its-get-start-state its-current-map))
;;; ITS State Machine
;;;
+(defvar its-disable-special-action nil)
+
;; Return CURSOR
(defun its-state-machine (state key emit)
(let ((next-state (its-get-next-state state key))
expr-output-back kst/t output keyseq back)
(cond
;; proceed to next status
- (next-state
+ ((and next-state
+ (not (and its-disable-special-action
+ (eq (its-get-kst/t next-state) t))))
(setq kst/t (its-get-kst/t next-state)
output (its-get-output next-state)
keyseq (its-get-keyseq next-state))
(cond
+ ;; Special actions.
+ ((eq kst/t t)
+ (funcall emit (cons "" keyseq) state 'its-cursor)
+ (apply (car output) (cdr output)))
+
;; Still, it's a intermediate state.
((its-kst-p kst/t)
(funcall emit next-state state nil))
(funcall emit next-state state 'its-cursor)
(its-state-machine-keyseq (substring keyseq kst/t) emit (< key 0)))
- ;; Here we arrive to a terminal state.
- ;; Emit a DSYL, and go ahead.
+ ;; Here we arrive to a terminal state.
+ ;; Emit a DSYL, and go ahead.
(t
(funcall emit next-state state 'its-cursor))))
(progn
(setq its-setup-fence-before-insert-SYL nil)
(its-setup-fence-mode)))
- (its-buffer-delete-SYL oldsyl)
- (its-update-latest-SYL newsyl)
- (let ((p (point)))
- (insert (its-get-output newsyl))
- (add-text-properties p (point)
- (list 'its-syl newsyl
- 'its-map its-current-map
- 'its-lang its-current-language
- 'intangible 'its-part-1))
- (if its-fence-face
- (put-text-property p (point) 'face its-fence-face))
- (its-set-cursor-status cursor)))
+ (let ((inhibit-read-only t))
+ (its-buffer-delete-SYL oldsyl)
+ (its-update-latest-SYL newsyl)
+ (let ((p (point)))
+ (insert (its-get-output newsyl))
+ (add-text-properties p (point)
+ (list 'its-map its-current-map
+ 'its-syl newsyl
+ 'egg-lang its-current-language
+ 'read-only t
+ 'intangible 'its-part-1))
+ (if its-fence-face
+ (put-text-property p (point) 'face (its-get-fence-face)))
+ (its-set-cursor-status cursor))))
(defun its-buffer-delete-SYL (syl)
(let ((len (length (its-get-output syl))))
(defun its-get-next-state (state key)
(let ((kst/t (its-get-kst/t state)))
- (cdr (assq key (car kst/t)))))
+ (and (listp kst/t)
+ (cdr (assq key (car kst/t))))))
;; XXX XXX XXX
(defun its-otherwise-match (expr key)
(emit (lambda (nsyl osyl cursor)
(its-update-latest-SYL nsyl)
cursor))
+ (its-current-map its-current-map)
+ (its-current-select-func its-current-select-func)
+ (its-current-language its-current-language)
+ (its-zhuyin its-zhuyin)
+ (its-previous-select-func its-previous-select-func)
cursor)
(if (null syl)
(setq syl (its-initial-ISYL)))
(t
its-latest-SYL))
(setq i (1+ i)))
- (if eol
+ (if (and syl eol)
(setq cursor (its-state-machine syl -1 emit)))
(not (eq cursor 'its-keyseq-test-failed))))
\f
(defun its-make-next-state (state key keyseq output &optional back)
(let ((next-state (its-new-state output keyseq back))
(kst (its-get-kst/t state)))
- (if kst
- (setcar kst (cons (cons key next-state) (car kst)))
+ (cond
+ ((null kst)
(its-set-kst state (list (list (cons key next-state)))))
+ ((consp kst)
+ (setcar kst (cons (cons key next-state) (car kst))))
+ (t
+ (error "Can't make new state after %S" (its-get-keyseq state))))
next-state))
+
+(defmacro its-defrule-select-mode-temporally (input select-func)
+ `(its-defrule ,input '(its-select-mode-temporally
+ ,(intern (concat "its-select-"
+ (symbol-name select-func))))
+ t))
\f
;;;
(defun its-beginning-of-input-buffer ()
(interactive)
- (its-input-end)
- (if (not (get-text-property (1- (point)) 'its-start))
- (let ((begpos (previous-single-property-change (point) 'its-start)))
- ;; Make SYLs have property of "part 2"
- (put-text-property begpos (point) 'intangible 'its-part-2)
- (goto-char begpos)))
- (its-put-cursor t))
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (if (not (get-text-property (1- (point)) 'its-start))
+ (let ((begpos (previous-single-property-change (point) 'its-start)))
+ ;; Make SYLs have property of "part 2"
+ (put-text-property begpos (point) 'intangible 'its-part-2)
+ (goto-char begpos)))
+ (its-put-cursor t)))
(defun its-end-of-input-buffer ()
(interactive)
- (its-input-end)
- (if (not (get-text-property (point) 'its-end))
- (let ((endpos (next-single-property-change (point) 'its-end)))
- ;; Make SYLs have property of "part 1"
- (put-text-property (point) endpos 'intangible 'its-part-1)
- (goto-char endpos)))
- (its-put-cursor t))
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (if (not (get-text-property (point) 'its-end))
+ (let ((endpos (next-single-property-change (point) 'its-end)))
+ ;; Make SYLs have property of "part 1"
+ (put-text-property (point) endpos 'intangible 'its-part-1)
+ (goto-char endpos)))
+ (its-put-cursor t)))
+
+(defun its-kill-line (n)
+ (interactive "p")
+ (let ((inhibit-read-only t)
+ (p (point)))
+ (its-input-end)
+ (if (> n 0)
+ (cond
+ ((get-text-property (1- (point)) 'its-start)
+ (its-cancel-input))
+ ((get-text-property (point) 'its-end)
+ (its-put-cursor t))
+ (t
+ (delete-region (next-single-property-change (point) 'its-end)
+ (point))
+ (its-put-cursor t)))
+ (cond
+ ((get-text-property (point) 'its-end)
+ (its-cancel-input))
+ ((get-text-property (1- (point)) 'its-start)
+ (its-put-cursor t))
+ (t
+ (delete-region (point)
+ (previous-single-property-change (point) 'its-start))
+ (its-put-cursor t))))))
+
+(defun its-cancel-input ()
+ (interactive)
+ (let ((inhibit-read-only t))
+ (delete-region (if (get-text-property (1- (point)) 'its-start)
+ (point)
+ (previous-single-property-change (1- (point)) 'its-start))
+ (if (get-text-property (point) 'its-end)
+ (point)
+ (next-single-property-change (point) 'its-end)))
+ (its-put-cursor t)
+ (its-exit-mode-internal)))
;; TODO: move in VSYL
(defun its-backward-SYL (n)
(interactive "p")
- (its-input-end)
- (let ((syl (get-text-property (1- (point)) 'its-syl))
- (p (point))
- (old-point (point)))
+ (let ((inhibit-read-only t)
+ syl p old-point)
+ (its-input-end)
+ (setq syl (get-text-property (1- (point)) 'its-syl)
+ p (point)
+ old-point (point))
(while (and syl (> n 0))
(setq p (- p (length (its-get-output syl))))
(setq syl (get-text-property (1- p) 'its-syl))
;; TODO: move in VSYL
(defun its-forward-SYL (n)
(interactive "p")
- (its-input-end)
- (let ((syl (get-text-property (point) 'its-syl))
- (p (point))
- (old-point (point)))
+ (let ((inhibit-read-only t)
+ syl p old-point)
+ (its-input-end)
+ (setq syl (get-text-property (point) 'its-syl)
+ p (point)
+ old-point (point))
(while (and syl (> n 0))
(setq p (+ p (length (its-get-output syl))))
(setq syl (get-text-property p 'its-syl))
;; TODO: handle VSYL. KILLFLAG
(defun its-delete-SYL (n killflag)
(interactive "p\nP")
- (its-input-end)
- (let ((syl (get-text-property (point) 'its-syl))
- (p (point)))
+ (let ((inhibit-read-only t)
+ syl p)
+ (its-input-end)
+ (setq syl (get-text-property (point) 'its-syl)
+ p (point))
(while (and syl (> n 0))
(setq p (+ p (length (its-get-output syl))))
(setq syl (get-text-property p 'its-syl))
(if (> n 0)
(progn
(its-put-cursor t)
- (signal 'args-out-of-range (list p n)))
+ (signal 'end-of-buffer nil))
(delete-region (point) p)
+ (its-put-cursor t)
;; Check if empty
- (let ((s (get-text-property (1- (point)) 'its-start))
- (e (get-text-property (point) 'its-end)))
- (if (and s e)
- (its-exit-mode-internal)
- (its-put-cursor t))))))
+ (if (and (get-text-property (1- (point)) 'its-start)
+ (get-text-property (1+ (point)) 'its-end))
+ (its-exit-mode-internal)))))
;; TODO: killflag
(defun its-delete-backward-SYL (n killflag)
(interactive "p\nP")
- (let ((syl (get-text-property (1- (point)) 'its-syl))
+ (let ((inhibit-read-only t)
+ (syl (get-text-property (1- (point)) 'its-syl))
(cursor (get-text-property (point) 'its-cursor)))
(if (null syl)
(signal 'beginning-of-buffer nil)
(setq syl (get-text-property (1- p) 'its-syl))
(setq n (1- n)))
(if (> n 0)
- (signal 'args-out-of-range (list p n))
+ (signal 'beginning-of-buffer nil)
(delete-region p (1+ (point))) ; also delete cursor
+ (its-put-cursor t)
;; Check if empty
- (let ((s (get-text-property (1- (point)) 'its-start))
- (e (get-text-property (point) 'its-end)))
- (if (and s e)
- (its-exit-mode-internal)
- (its-put-cursor t))))))
+ (if (and (get-text-property (1- (point)) 'its-start)
+ (get-text-property (1+ (point)) 'its-end))
+ (its-exit-mode-internal)))))
(defvar its-delete-by-keystroke nil)
(defun its-delete-backward-SYL-by-keystroke (n killflag)
(interactive "p\nP")
- (let ((its-delete-by-keystroke t))
+ (let ((inhibit-read-only t)
+ (its-delete-by-keystroke t))
(its-delete-backward-SYL n killflag)))
;; TODO: killflag
(len (length keyseq))
(p (- (point) (length (its-get-output syl))))
(its-current-map (get-text-property (1- (point)) 'its-map))
+ (its-current-language (get-text-property (1- (point)) 'egg-lang))
back pp)
(if (< n 0)
(signal 'args-out-of-range (list (- (point) n) (point))))
;; Check if empty
((and (get-text-property (1- (point)) 'its-start)
(get-text-property (1+ (point)) 'its-end))
- ;; Delete CURSOR
- (delete-region (point) (1+ (point)))
(its-exit-mode-internal))
((and its-delete-by-keystroke
(null (its-concrete-DSYL-p (get-text-property (1- p) 'its-syl))))
(defun its-transpose-chars (n)
(interactive "p")
- (let ((syl (get-text-property (1- (point)) 'its-syl))
+ (let ((inhibit-read-only t)
+ (syl (get-text-property (1- (point)) 'its-syl))
(cursor (get-text-property (point) 'its-cursor))
keyseq len)
(cond
(delete-region (- (point) (length (its-get-output syl))) (point))
(its-state-machine-keyseq keyseq 'its-buffer-ins/del-SYL)))))))
+(defun its-yank (&optional arg)
+ (interactive "*P")
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (its-put-cursor t)
+ (yank arg)
+ (its-setup-yanked-portion (region-beginning) (region-end))))
+
+(defun its-yank-pop (arg)
+ (interactive "*p")
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (its-put-cursor t)
+ (yank-pop arg)
+ (its-setup-yanked-portion (region-beginning) (region-end))))
+
+(defun its-setup-yanked-portion (start end)
+ (let ((yank-before (eq (point) end))
+ (max-sisheng (make-char 'chinese-sisheng 127))
+ p syl lang)
+ (remove-text-properties start end '(intangible nil))
+ (egg-separate-languages start end t)
+ (goto-char start)
+ (while (< (point) end)
+ (setq p (point)
+ lang (get-text-property p 'egg-lang))
+ (if (and
+ (or (equal lang "Chinese-GB") (equal lang "Chinese-CNS"))
+ (<= (following-char) max-sisheng)
+ (setq len (egg-chinese-syllable (buffer-substring (point) end))))
+ (goto-char (+ (point) len))
+ (forward-char))
+ (setq syl (buffer-substring-no-properties p (point)))
+ (put-text-property p (point) 'its-syl (cons syl syl))
+ (if its-fence-face
+ (let ((its-current-language (get-text-property p 'egg-lang)))
+ (put-text-property p (point) 'face (its-get-fence-face)))))
+ (if yank-before
+ (add-text-properties start end '(read-only t intangible its-part-1))
+ (add-text-properties start end '(read-only t intangible its-part-2))
+ (delete-region (point) (1+ (point)))
+ (goto-char start)
+ (its-put-cursor t))))
+
;; Return VOID
(defun its-input-end ()
(let ((cursor (get-text-property (point) 'its-cursor)))
(defun its-exit-mode ()
"Exit ITS mode."
(interactive)
- (its-input-end)
- (its-exit-mode-internal))
-
-(defun its-exit-mode-off-input-method ()
- "Exit ITS mode."
- (interactive)
- (its-input-end)
- (its-exit-mode-internal)
- (inactivate-input-method))
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (its-put-cursor t)
+ (its-exit-mode-internal)))
;; TODO: handle overwrite-mode, insertion-hook, fill...
(defun its-exit-mode-internal (&optional proceed-to-conversion)
- (let (start end)
+ (let (start end s e)
+ (its-select-previous-mode t)
+ ;; Delete CURSOR
+ (delete-region (point) (1+ (point)))
;; Delete open fence
- (if (get-text-property (1- (point)) 'its-start)
- (setq start (1- (point)))
- (setq start (1- (previous-single-property-change (point) 'its-start))))
- (delete-region start (1+ start))
+ (setq s (if (get-text-property (1- (point)) 'its-start)
+ (point)
+ (previous-single-property-change (point) 'its-start))
+ start (- s (length its-fence-open)))
+ (delete-region start s)
;; Delete close fence
- (if (get-text-property (point) 'its-end)
- (setq end (point))
- (setq end (next-single-property-change (point) 'its-end)))
- (delete-region end (1+ end))
- ;; Remove all properties added by ITS
- (remove-text-properties start end '(its-map nil
- face nil
- intangible nil))
+ (setq end (if (get-text-property (point) 'its-end)
+ (point)
+ (next-single-property-change (point) 'its-end))
+ e (+ end (length its-fence-close)))
+ (delete-region end e)
(if proceed-to-conversion
(egg-convert-region start end)
- (remove-text-properties start end '(its-lang nil its-syl nil))
+ ;; Remove all properties
+ (set-text-properties start end nil)
(egg-do-auto-fill)
(run-hooks 'input-method-after-insert-chunk-hook))))
(defun its-kick-convert-region ()
(interactive)
- (its-input-end)
- (its-exit-mode-internal t))
+ (let ((inhibit-read-only t))
+ (its-input-end)
+ (its-put-cursor t)
+ (its-exit-mode-internal t)))
+
+(defun its-kick-convert-region-or-self-insert ()
+ (interactive)
+ (let ((syl (and (null (get-text-property (point) 'its-cursor))
+ (get-text-property (1- (point)) 'its-syl))))
+ (if (its-keyseq-acceptable-p (vector last-command-char) syl)
+ (its-self-insert-char)
+ (its-kick-convert-region))))
(defun its-in-fence-p ()
(eq (get-text-property (point) 'intangible) 'its-part-2))
(oldlen (length its-translation-result)))
(setq its-translation-result (concat its-translation-result output))
(put-text-property oldlen (length its-translation-result)
- 'its-lang its-current-language
+ 'egg-lang its-current-language
its-translation-result)))
cursor)
(defun its-translate-region (start end)
(interactive "r")
(its-translate-region-internal start end)
- (remove-text-properties start (point) '(its-lang nil)))
+ (set-text-properties start (point) nil))
(defun its-translate-region-internal (start end)
(setq its-translation-result "")
(delete-region start end)
(insert its-translation-result)))
\f
+(defun its-set-mode-line-title ()
+ (let ((title (its-get-indicator its-current-map)))
+ (setq current-input-method-title (if its-previous-select-func
+ (concat "<" title ">")
+ title))
+ (force-mode-line-update)))
+
+(defun its-select-mode-temporally (func)
+ (let ((select-func its-current-select-func))
+ (funcall func)
+ (if (null its-previous-select-func)
+ (setq its-previous-select-func select-func))
+ (its-set-mode-line-title)))
+
+(defun its-select-previous-mode (&optional quiet)
+ (interactive)
+ (if (null its-previous-select-func)
+ (if (null quiet)
+ (beep))
+ (funcall its-previous-select-func)
+ (setq its-previous-select-func nil)
+ (its-set-mode-line-title)))
+
(provide 'its)
;;; its.el ends here.
+;;; its/hangul.el --- Hangul Input in Egg Input Method Architecture
+
+;; Copyright (C) 1997, 1998 Mule Project,
+;; Powered by Electrotechnical Laboratory, JAPAN.
+;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
+
+;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
+;; KATAYAMA Yoshio <kate@pfu.co.jp>
+
+;; This file will be part of GNU Emacs (in future).
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+
+;;; Code:
+
(eval-when-compile
(require 'its)
(require 'cl))
+(defvar its-hangul-enable-jeonkak-alphabet t "*Enable Jeonkak alphabet")
+(defvar its-hangul-period ". " "*\e$(C#.\e(B") ; ". " "\e$(C#.\e(B"
+(defvar its-hangul-comma ", " "*\e$(C#,\e(B") ; ", " "\e$(C#,\e(B"
(defvar its-hangul-open-bracket "\e$(C!8\e(B" "*[") ; "\e$(C#[\e(B"
-(defvar its-hangul-close-bracket "\e$(C!9\e(B" "*]") ; "\e$(C#]\e(B"
+(defvar its-hangul-close-bracket "\e$(C!9\e(B" "*]") ; "\e$(C#]\e(B"
(eval-when-compile
-
- (defvar its-jeonkak-escape "J")
- (defvar its-pankak-escape "B")
-
(defconst its-hangul-kijuhynbmlopOP
(its-make-class+back "[kijuhynbmlopOP]" -2))
(defconst its-hangul-kijuhynbmlopP
(its-defrule-otherwise state output))))
(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")
+ (defconst its-pankak-escape "X")
+
+ (its-defrule-select-mode-temporally "B" downcase)
+ (its-defrule-select-mode-temporally "J" jeonkak-downcase)
+
(its-defrule-hangul "r" "\e$(C$!\e(B")
(its-defrule-hangul "s" "\e$(C$$\e(B")
(its-defrule-hangul "e" "\e$(C$'\e(B")
(its-define-hangul "glt" "\e$(CH}\e(B" kijuhynbmlopOP)
(its-define-hangul "gld" "\e$(CH~\e(B" kijuhynbmlopOP))
- ;;; Jeonkak Symbols
-
- (its-defrule "1" "\e$(C#1\e(B")
- (its-defrule "2" "\e$(C#2\e(B")
- (its-defrule "3" "\e$(C#3\e(B")
- (its-defrule "4" "\e$(C#4\e(B")
- (its-defrule "5" "\e$(C#5\e(B")
- (its-defrule "6" "\e$(C#6\e(B")
- (its-defrule "7" "\e$(C#7\e(B")
- (its-defrule "8" "\e$(C#8\e(B")
- (its-defrule "9" "\e$(C#9\e(B")
- (its-defrule "0" "\e$(C#0\e(B")
-
- ;;(its-defrule " " "\e$(C!!\e(B")
- (its-defrule "!" "\e$(C#!\e(B")
- (its-defrule "@" "\e$(C#@\e(B")
- (its-defrule "#" "\e$(C##\e(B")
- (its-defrule "$" "\e$(C#$\e(B")
- (its-defrule "%" "\e$(C#%\e(B")
- (its-defrule "^" "\e$(C#^\e(B")
- (its-defrule "&" "\e$(C#&\e(B")
- (its-defrule "*" "\e$(C#*\e(B")
- (its-defrule "(" "\e$(C#(\e(B")
- (its-defrule ")" "\e$(C#)\e(B")
- (its-defrule "-" "\e$(C#-\e(B")
- (its-defrule "=" "\e$(C#=\e(B")
- (its-defrule "`" "\e$(C#`\e(B")
- (its-defrule "\\" "\e$(C#\\e(B")
- (its-defrule "|" "\e$(C#|\e(B")
- (its-defrule "_" "\e$(C#_\e(B")
- (its-defrule "+" "\e$(C#+\e(B")
- (its-defrule "~" "\e$(C#~\e(B")
- (its-defrule "[" "\e$(C!8\e(B");;(its-defrule "[" "\e$(C#[\e(B")
- (its-defrule "]" "\e$(C!9\e(B");;(its-defrule "]" "\e$(C#]\e(B")
- (its-defrule "{" "\e$(C#{\e(B")
- (its-defrule "}" "\e$(C#}\e(B")
- (its-defrule ":" "\e$(C#:\e(B")
- (its-defrule ";" "\e$(C#;\e(B")
- (its-defrule "\"" "\e$(C#"\e(B")
- (its-defrule "'" "\e$(C#'\e(B")
- (its-defrule "<" "\e$(C#<\e(B")
- (its-defrule ">" "\e$(C#>\e(B")
- (its-defrule "?" "\e$(C#?\e(B")
- (its-defrule "/" "\e$(C#/\e(B")
- (its-defrule "," "\e$(C#,\e(B")
- (its-defrule "." "\e$(C#.\e(B")
-
- (its-defrule (concat its-jeonkak-escape " ") "\e$(C!!\e(B")
- (let ((i ?!))
- (while (<= i ?~)
- (its-defrule (concat its-jeonkak-escape (char-to-string i))
- (char-to-string (+ (- ?\e$(C#!\e(B ?!) i)))
- (setq i (1+ i))))
-
- ;;; pankak
- (let ((i ?!))
- (while (<= i ?~)
- (its-defrule (concat its-pankak-escape (char-to-string i))
- (char-to-string i))
- (setq i (1+ i)))))
+ (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")
+ ("5" . "\e$(C#5\e(B") ("6" . "\e$(C#6\e(B") ("7" . "\e$(C#7\e(B") ("8" . "\e$(C#8\e(B")
+ ("9" . "\e$(C#9\e(B") ("0" . "\e$(C#0\e(B")
+ (" " . "\e$(C!!\e(B") ("!" . "\e$(C#!\e(B") ("@" . "\e$(C#@\e(B") ("#" . "\e$(C##\e(B")
+ ("$" . "\e$(C#$\e(B") ("%" . "\e$(C#%\e(B") ("^" . "\e$(C#^\e(B") ("&" . "\e$(C#&\e(B")
+ ("*" . "\e$(C#*\e(B") ("(" . "\e$(C#(\e(B") (")" . "\e$(C#)\e(B")
+ ("-" . "\e$(C#-\e(B") ("=" . "\e$(C#=\e(B") ("`" . "\e$(C#`\e(B") ("\\" . "\e$(C#\\e(B")
+ ("|" . "\e$(C#|\e(B") ("_" . "\e$(C#_\e(B") ("+" . "\e$(C#+\e(B") ("~" . "\e$(C#~\e(B")
+ ("[" . "\e$(C!8\e(B") ("]" . "\e$(C!9\e(B") ("{" . "\e$(C#{\e(B") ("}" . "\e$(C#}\e(B")
+ (":" . "\e$(C#:\e(B") (";" . "\e$(C#;\e(B") ("\"" . "\e$(C#"\e(B") ("'" . "\e$(C#'\e(B")
+ ("<" . "\e$(C#<\e(B") (">" . "\e$(C#>\e(B") ("?" . "\e$(C#?\e(B") ("/" . "\e$(C#/\e(B")
+ ("," . "\e$(C#,\e(B") ("." . "\e$(C#.\e(B")
+ ("a" . "\e$(C#a\e(B") ("b" . "\e$(C#b\e(B") ("c" . "\e$(C#c\e(B") ("d" . "\e$(C#d\e(B")
+ ("e" . "\e$(C#e\e(B") ("f" . "\e$(C#f\e(B") ("g" . "\e$(C#g\e(B") ("h" . "\e$(C#h\e(B")
+ ("i" . "\e$(C#i\e(B") ("j" . "\e$(C#j\e(B") ("k" . "\e$(C#k\e(B") ("l" . "\e$(C#l\e(B")
+ ("m" . "\e$(C#m\e(B") ("n" . "\e$(C#n\e(B") ("o" . "\e$(C#o\e(B") ("p" . "\e$(C#p\e(B")
+ ("q" . "\e$(C#q\e(B") ("r" . "\e$(C#r\e(B") ("s" . "\e$(C#s\e(B") ("t" . "\e$(C#t\e(B")
+ ("u" . "\e$(C#u\e(B") ("v" . "\e$(C#v\e(B") ("w" . "\e$(C#w\e(B") ("x" . "\e$(C#x\e(B")
+ ("y" . "\e$(C#y\e(B") ("z" . "\e$(C#z\e(B")
+ ("A" . "\e$(C#A\e(B") ("B" . "\e$(C#B\e(B") ("C" . "\e$(C#C\e(B") ("D" . "\e$(C#D\e(B")
+ ("E" . "\e$(C#E\e(B") ("F" . "\e$(C#F\e(B") ("G" . "\e$(C#G\e(B") ("H" . "\e$(C#H\e(B")
+ ("I" . "\e$(C#I\e(B") ("J" . "\e$(C#J\e(B") ("K" . "\e$(C#K\e(B") ("L" . "\e$(C#L\e(B")
+ ("M" . "\e$(C#M\e(B") ("N" . "\e$(C#N\e(B") ("O" . "\e$(C#O\e(B") ("P" . "\e$(C#P\e(B")
+ ("Q" . "\e$(C#Q\e(B") ("R" . "\e$(C#R\e(B") ("S" . "\e$(C#S\e(B") ("T" . "\e$(C#T\e(B")
+ ("U" . "\e$(C#U\e(B") ("V" . "\e$(C#V\e(B") ("W" . "\e$(C#W\e(B") ("X" . "\e$(C#X\e(B")
+ ("Y" . "\e$(C#Y\e(B") ("Z" . "\e$(C#Z\e(B")))
+ (let ((in (car ascii)) (out (cdr ascii)))
+ (its-defrule (concat its-pankak-escape in) in)
+ (its-defrule (concat its-jeonkak-escape in) out))))
(define-its-state-machine-append its-hangul-map
- (its-defrule "[" its-hangul-open-bracket nil t)
- (its-defrule "]" its-hangul-close-bracket nil t)
- )
+ (its-defrule "[" its-hangul-open-bracket)
+ (its-defrule "]" its-hangul-close-bracket)
+ (its-defrule "." its-hangul-period)
+ (its-defrule "," its-hangul-comma)
+
+ (if its-hangul-enable-jeonkak-alphabet
+ (progn
+ (its-defrule "1" "\e$(C#1\e(B") (its-defrule "2" "\e$(C#2\e(B")
+ (its-defrule "3" "\e$(C#3\e(B") (its-defrule "4" "\e$(C#4\e(B")
+ (its-defrule "5" "\e$(C#5\e(B") (its-defrule "6" "\e$(C#6\e(B")
+ (its-defrule "7" "\e$(C#7\e(B") (its-defrule "8" "\e$(C#8\e(B")
+ (its-defrule "9" "\e$(C#9\e(B") (its-defrule "0" "\e$(C#0\e(B")
+ (its-defrule "!" "\e$(C#!\e(B") (its-defrule "@" "\e$(C#@\e(B")
+ (its-defrule "#" "\e$(C##\e(B") (its-defrule "$" "\e$(C#$\e(B")
+ (its-defrule "%" "\e$(C#%\e(B") (its-defrule "^" "\e$(C#^\e(B")
+ (its-defrule "&" "\e$(C#&\e(B") (its-defrule "*" "\e$(C#*\e(B")
+ (its-defrule "(" "\e$(C#(\e(B") (its-defrule ")" "\e$(C#)\e(B")
+ (its-defrule "-" "\e$(C#-\e(B") (its-defrule "~" "\e$(C#~\e(B")
+ (its-defrule "=" "\e$(C#=\e(B") (its-defrule "`" "\e$(C#`\e(B")
+ (its-defrule "\\" "\e$(C#\\e(B") (its-defrule "|" "\e$(C#|\e(B")
+ (its-defrule "_" "\e$(C#_\e(B") (its-defrule "+" "\e$(C#+\e(B")
+ (its-defrule "{" "\e$(C#{\e(B") (its-defrule "}" "\e$(C#}\e(B")
+ (its-defrule ":" "\e$(C#:\e(B") (its-defrule ";" "\e$(C#;\e(B")
+ (its-defrule "\"" "\e$(C#"\e(B") (its-defrule "'" "\e$(C#'\e(B")
+ (its-defrule "<" "\e$(C#<\e(B") (its-defrule ">" "\e$(C#>\e(B")
+ (its-defrule "?" "\e$(C#?\e(B") (its-defrule "/" "\e$(C#/\e(B"))
+ (progn
+ (its-defrule "1" "1") (its-defrule "2" "2")
+ (its-defrule "3" "3") (its-defrule "4" "4")
+ (its-defrule "5" "5") (its-defrule "6" "6")
+ (its-defrule "7" "7") (its-defrule "8" "8")
+ (its-defrule "9" "9") (its-defrule "0" "0")
+ (its-defrule "!" "!") (its-defrule "@" "@")
+ (its-defrule "#" "#") (its-defrule "$" "$")
+ (its-defrule "%" "%") (its-defrule "^" "^")
+ (its-defrule "&" "&") (its-defrule "*" "*")
+ (its-defrule "(" "(") (its-defrule ")" ")")
+ (its-defrule "-" "-") (its-defrule "~" "~")
+ (its-defrule "=" "=") (its-defrule "`" "`")
+ (its-defrule "\\" "\\") (its-defrule "|" "|")
+ (its-defrule "_" "_") (its-defrule "+" "+")
+ (its-defrule "{" "{") (its-defrule "}" "}")
+ (its-defrule ":" ":") (its-defrule ";" ";")
+ (its-defrule "\"" "\"") (its-defrule "'" "'")
+ (its-defrule "<" "<") (its-defrule ">" ">")
+ (its-defrule "?" "?") (its-defrule "/" "/"))))
(provide 'its/hangul)
(define-its-state-machine its-hira-map
"roma-kana" "\e$B$"\e(B" "Japanese" nil
"Map for Romaji-Hiragana translation. (Japanese)"
+
(defconst its-zenkaku-escape "Z") ;; Escape character to Zenkaku inputs
(defconst its-hankaku-escape "~") ;; Escape character to Hankaku inputs
+ (its-defrule-select-mode-temporally "q" downcase)
+ (its-defrule-select-mode-temporally "Q" zenkaku-downcase)
+
;;; k k
;;; kk \e$B$C\e(Bk
;;; kka \e$B$C$+\e(B
(its-defrule "nn" "\e$B$s\e(B")
(its-defrule "nn" "\e$B$s\e(B" -1))
- (its-defrule "-" its-hira-horizontal)
- (its-defrule "[" its-hira-open-bracket)
- (its-defrule "]" its-hira-close-bracket)
+ (its-defrule "-" its-hira-horizontal)
+ (its-defrule "[" its-hira-open-bracket)
+ (its-defrule "]" its-hira-close-bracket)
(its-defrule "." its-hira-period)
(its-defrule "," its-hira-comma)
(its-defrule "=" "\e$B!a\e(B") (its-defrule "`" "\e$B!.\e(B")
(its-defrule "\\" "\e$B!o\e(B") (its-defrule "|" "\e$B!C\e(B")
(its-defrule "_" "\e$B!2\e(B") (its-defrule "+" "\e$B!\\e(B")
- (its-defrule "~" "\e$B!1\e(B" nil t)
- (its-defrule "{" "\e$B!P\e(B")
- (its-defrule "}" "\e$B!Q\e(B") (its-defrule ":" "\e$B!'\e(B")
- (its-defrule ";" "\e$B!(\e(B") (its-defrule "\"" "\e$B!I\e(B")
- (its-defrule "'" "\e$B!G\e(B") (its-defrule "<" "\e$B!c\e(B")
- (its-defrule ">" "\e$B!d\e(B") (its-defrule "?" "\e$B!)\e(B")
- (its-defrule "/" "\e$B!?\e(B"))
+ (its-defrule "{" "\e$B!P\e(B") (its-defrule "}" "\e$B!Q\e(B")
+ (its-defrule ":" "\e$B!'\e(B") (its-defrule ";" "\e$B!(\e(B")
+ (its-defrule "\"" "\e$B!I\e(B") (its-defrule "'" "\e$B!G\e(B")
+ (its-defrule "<" "\e$B!c\e(B") (its-defrule ">" "\e$B!d\e(B")
+ (its-defrule "?" "\e$B!)\e(B") (its-defrule "/" "\e$B!?\e(B"))
(progn
(its-defrule "1" "1") (its-defrule "2" "2")
(its-defrule "3" "3") (its-defrule "4" "4")
(its-defrule "&" "&") (its-defrule "*" "*")
(its-defrule "(" "(") (its-defrule ")" ")")
(its-defrule "=" "=") (its-defrule "`" "`")
- (its-defrule "\\" "\\") (its-defrule "|" "|")
+ (its-defrule "\\" "\\") (its-defrule "|" "|")
(its-defrule "_" "_") (its-defrule "+" "+")
- (its-defrule "~" "~" nil t)
- (its-defrule "{" "{")
- (its-defrule "}" "}") (its-defrule ":" ":")
- (its-defrule ";" ";") (its-defrule "\"" "\"")
- (its-defrule "'" "'") (its-defrule "<" "<")
- (its-defrule ">" ">") (its-defrule "?" "?")
- (its-defrule "/" "/")))
+ (its-defrule "{" "{") (its-defrule "}" "}")
+ (its-defrule ":" ":") (its-defrule ";" ";")
+ (its-defrule "\"" "\"") (its-defrule "'" "'")
+ (its-defrule "<" "<") (its-defrule ">" ">")
+ (its-defrule "?" "?") (its-defrule "/" "/")))
)
(provide 'its/hira)
+;;; its/pinyin.el --- Pinyin Input in Egg Input Method Architecture
+
+;; Copyright (C) 1997, 1998 Mule Project,
+;; Powered by Electrotechnical Laboratory, JAPAN.
+;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
+
+;; Author: KATAYAMA Yoshio <kate@pfu.co.jp>
+
+;; This file will be part of GNU Emacs (in future).
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+
+;;; Code:
+
(eval-when-compile
(require 'its)
(require 'cl))
+(defvar its-pinyin-cn-enable-quanjioao-alphabet t "*Enable Quanjiao alphabet")
(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-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
- (defvar its-quanjiao-escape "Z")
- (defvar its-banjiao-escape "X")
-
(defconst its-pinyin-term
(char-to-string (make-char 'chinese-sisheng ?@)))
state))
(defmacro its-do-sisheng-table (list)
- `(progn ,@(mapcar (lambda (syl)
- `(its-define-sisheng ,(car syl) ,(cdr syl)))
- list)))
+ `(progn
+ ,@(mapcar (lambda (syl)
+ `(its-define-sisheng ,@syl))
+ list)))
(defmacro its-define-sisheng (shengmu yunmu)
`(let ((qing (nth 5 ,yunmu)) (y (car ,yunmu))
(UO '("uo" "u\e(0-\e(B" "u\e(0.\e(B" "u\e(0/\e(B" "u\e(00\e(B" "uo" )))
(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)
- ((- B C D F G H K L M N P R S T W Y Z CH SH ZH ) . AN)
- ((- B C D F G H K L M N P R S T W Y Z CH SH ZH ) . ANG)
- ((- B C D G H K L M N P R S T Y Z CH SH ZH ) . AO)
- ((- C D G H K L M N R S T Y Z CH SH ZH ) . E)
- ((- B C D F G H K L M N P T W Z SH ZH ) . EI)
- ((- B C D F G H K M N P R S W Z CH SH ZH ) . EN)
- ((- B C D F G H K L M N P R S T W Z CH SH ZH ) . ENG)
- ((- ) . ER)
- (( B C D J L M N P Q R S T X Y Z CH SH ZH ) . I)
- (( D J L Q X ) . IA)
- (( B D J L M N P Q T X ) . IAN)
- (( J L N Q X ) . IANG)
- (( B D J L M N P Q T X ) . IAO)
- (( B D J L M N P Q T X ) . IE)
- (( B J L M N P Q X Y ) . IN)
- (( B D J L M N P Q T X Y ) . ING)
- (( J Q X ) . IONG)
- (( D J L M N Q X ) . IU)
- ((- B F L M P W Y ) . O)
- (( C D G H K L N R S T Y Z CH ZH ) . ONG)
- ((- C D F G H K L M N P R S T Y Z CH SH ZH ) . OU)
- (( B C D F G H J K L M N P Q R S T W X Y Z CH SH ZH ) . U)
- (( L N ) . V)
- (( G H K R CH SH ZH ) . UA)
- (( G H K CH SH ZH ) . UAI)
- (( C D G H J K L N Q R S T X Y Z CH SH ZH ) . UAN)
- (( G H K CH SH ZH ) . UANG)
- (( J Q X Y ) . UE)
- (( L N ) . VE)
- (( C D G H K R S T Z CH SH ZH ) . UI)
- (( C D G H J K L Q R S T X Y Z CH SH ZH ) . UN)
- (( C D G H K L N R S T Z CH SH ZH ) . UO)
-
- ((J Q X) . (cons "a" (cdr IA )))
- ((J Q X) . (cons "ai" (cdr IA )))
- ((J Q X) . (cons "an" (cdr IAN )))
- ((J Q X) . (cons "ang" (cdr IANG)))
- ((J Q X) . (cons "ao" (cdr IAO )))
- ((J Q X) . (cons "e" (cdr IE )))
- ((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 )))))
+ (((- 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)
+ ((- B C D F G H K L M N P R S T W Y Z CH SH ZH ) AN)
+ ((- B C D F G H K L M N P R S T W Y Z CH SH ZH ) ANG)
+ ((- B C D G H K L M N P R S T Y Z CH SH ZH ) AO)
+ ((- C D G H K L M N R S T Y Z CH SH ZH ) E)
+ ((- B C D F G H K L M N P T W Z SH ZH ) EI)
+ ((- B C D F G H K M N P R S W Z CH SH ZH ) EN)
+ ((- B C D F G H K L M N P R S T W Z CH SH ZH ) ENG)
+ ((- ) ER)
+ (( B C D J L M N P Q R S T X Y Z CH SH ZH ) I)
+ (( D J L Q X ) IA)
+ (( B D J L M N P Q T X ) IAN)
+ (( J L N Q X ) IANG)
+ (( B D J L M N P Q T X ) IAO)
+ (( B D J L M N P Q T X ) IE)
+ (( B J L M N P Q X Y ) IN)
+ (( B D J L M N P Q T X Y ) ING)
+ (( J Q X ) IONG)
+ (( D J L M N Q X ) IU)
+ ((- B F L M P W Y ) O)
+ (( C D G H K L N R S T Y Z CH ZH ) ONG)
+ ((- C D F G H K L M N P R S T Y Z CH SH ZH ) OU)
+ (( B C D F G H J K L M N P Q R S T W X Y Z CH SH ZH ) U)
+ (( L N ) V)
+ (( G H K R CH SH ZH ) UA)
+ (( G H K CH SH ZH ) UAI)
+ (( C D G H J K L N Q R S T X Y Z CH SH ZH ) UAN)
+ (( G H K CH SH ZH ) UANG)
+ (( J Q X Y ) UE)
+ (( L N ) VE)
+ (( C D G H K R S T Z CH SH ZH ) UI)
+ (( C D G H J K L Q R S T X Y Z CH SH ZH ) UN)
+ (( C D G H K L N R S T Z CH SH ZH ) UO)
+
+ ((J Q X) (cons "a" (cdr IA )))
+ ((J Q X) (cons "ai" (cdr IA )))
+ ((J Q X) (cons "an" (cdr IAN )))
+ ((J Q X) (cons "ang" (cdr IANG)))
+ ((J Q X) (cons "ao" (cdr IAO )))
+ ((J Q X) (cons "e" (cdr IE )))
+ ((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" "")
(define-its-state-machine its-pinyin-cn-map
"pinyin-cn" "\e$AF4\e(BG" "Chinese-GB"
"Map for Pinyin input. (Chinese-GB)"
+
+ (defconst its-quanjiao-escape "Z")
+ (defconst its-banjiao-escape "X")
+
+ (its-defrule-select-mode-temporally "B" downcase)
+ (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")
("U" . "\e$A#U\e(B") ("V" . "\e$A#V\e(B") ("W" . "\e$A#W\e(B") ("X" . "\e$A#X\e(B")
("Y" . "\e$A#Y\e(B") ("Z" . "\e$A#Z\e(B")))
(let ((in (car ascii)) (out (cdr ascii)))
- (if (and (or (string< in "a") (string< "z" in))
- (null (equal in " "))
- (null (equal in its-banjiao-escape))
- (null (equal in its-quanjiao-escape)))
- (progn
- (its-defrule in in)
- (its-defrule (concat (downcase its-banjiao-escape) in) in)
- (its-defrule (concat (downcase its-quanjiao-escape) in) out)))
(its-defrule (concat its-banjiao-escape in) in)
(its-defrule (concat its-quanjiao-escape in) out)))
- (its-defrule "," "\e$A#,\e(B" nil t)
- (its-defrule "." "\e$A!#\e(B" nil t)
- (its-defrule "/" "\e$A!"\e(B" nil t)
- (its-defrule ":" "\e$A#:\e(B" nil t)
- (its-defrule ";" "\e$A#;\e(B" nil t)
- (its-defrule "?" "\e$A#?\e(B" nil t)
- (its-defrule "!" "\e$A#!\e(B" nil t)
- (its-defrule "-" "\e$A!*\e(B" nil t))
+ (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$A#!\e(B"))
(define-its-state-machine its-pinyin-tw-map
"pinyin-tw" "\e$(GQ;\e(BC" "Chinese-CNS"
"Map for Pinyin input."
+
+ (defconst its-quanjiao-escape "Z")
+ (defconst its-banjiao-escape "X")
+
+ (its-defrule-select-mode-temporally "B" downcase)
+ (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")
("U" . "\e$(G$U\e(B") ("V" . "\e$(G$V\e(B") ("W" . "\e$(G$W\e(B") ("X" . "\e$(G$X\e(B")
("Y" . "\e$(G$Y\e(B") ("Z" . "\e$(G$Z\e(B")))
(let ((in (car ascii)) (out (cdr ascii)))
- (if (and (or (string< in "a") (string< "z" in))
- (null (equal in " "))
- (null (equal in its-banjiao-escape))
- (null (equal in its-quanjiao-escape)))
- (progn
- (its-defrule in in)
- (its-defrule (concat (downcase its-banjiao-escape) in) in)
- (its-defrule (concat (downcase its-quanjiao-escape) in) out)))
(its-defrule (concat its-banjiao-escape in) in)
(its-defrule (concat its-quanjiao-escape in) out)))
- (its-defrule "," "\e$(G!"\e(B" nil t)
- (its-defrule "." "\e$(G!$\e(B" nil t)
- (its-defrule "/" "\e$(G!#\e(B" nil t)
- (its-defrule ":" "\e$(G!(\e(B" nil t)
- (its-defrule ";" "\e$(G!'\e(B" nil t)
- (its-defrule "?" "\e$(G!)\e(B" nil t)
- (its-defrule "!" "\e$(G!*\e(B" nil t)
- (its-defrule "-" "\e$(G"1\e(B" nil t)
- (its-defrule "[" "\e$(G!V\e(B" nil t)
- (its-defrule "]" "\e$(G!W\e(B" nil t))
+ (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!'\e(B")
+ (its-defrule "?" "\e$(G!)\e(B")
+ (its-defrule "!" "\e$(G!*\e(B"))
(define-its-state-machine-append its-pinyin-cn-map
- (its-defrule "[" its-pinyin-cn-open-braket nil t)
- (its-defrule "]" its-pinyin-cn-close-braket nil t))
+ (its-defrule "[" its-pinyin-cn-open-braket)
+ (its-defrule "]" its-pinyin-cn-close-braket)
+
+ (if its-pinyin-cn-enable-quanjioao-alphabet
+ (progn
+ (its-defrule "1" "\e$A#1\e(B") (its-defrule "2" "\e$A#2\e(B")
+ (its-defrule "3" "\e$A#3\e(B") (its-defrule "4" "\e$A#4\e(B")
+ (its-defrule "5" "\e$A#5\e(B") (its-defrule "6" "\e$A#6\e(B")
+ (its-defrule "7" "\e$A#7\e(B") (its-defrule "8" "\e$A#8\e(B")
+ (its-defrule "9" "\e$A#9\e(B") (its-defrule "0" "\e$A#0\e(B")
+ (its-defrule "@" "\e$A#@\e(B")
+ (its-defrule "#" "\e$A##\e(B") (its-defrule "$" "\e$A!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$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$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$A#<\e(B") (its-defrule ">" "\e$A#>\e(B"))
+ (progn
+ (its-defrule "1" "1") (its-defrule "2" "2")
+ (its-defrule "3" "3") (its-defrule "4" "4")
+ (its-defrule "5" "5") (its-defrule "6" "6")
+ (its-defrule "7" "7") (its-defrule "8" "8")
+ (its-defrule "9" "9") (its-defrule "0" "0")
+ (its-defrule "@" "@")
+ (its-defrule "#" "#") (its-defrule "$" "$")
+ (its-defrule "%" "%") (its-defrule "^" "^")
+ (its-defrule "&" "&") (its-defrule "*" "*")
+ (its-defrule "(" "(") (its-defrule ")" ")")
+ (its-defrule "-" "-") (its-defrule "~" "~")
+ (its-defrule "=" "=") (its-defrule "`" "`")
+ (its-defrule "\\" "\\") (its-defrule "|" "|")
+ (its-defrule "_" "_") (its-defrule "+" "+")
+ (its-defrule "{" "{") (its-defrule "}" "}")
+ (its-defrule "\"" "\"") (its-defrule "'" "'")
+ (its-defrule "<" "<") (its-defrule ">" ">"))))
(define-its-state-machine-append its-pinyin-tw-map
- (its-defrule "[" its-pinyin-tw-open-braket nil t)
- (its-defrule "]" its-pinyin-tw-close-braket nil t))
+ (its-defrule "[" its-pinyin-tw-open-braket)
+ (its-defrule "]" its-pinyin-tw-close-braket)
+
+ (if its-pinyin-tw-enable-quanjioao-alphabet
+ (progn
+ (its-defrule "1" "\e$(G$"\e(B") (its-defrule "2" "\e$(G$#\e(B")
+ (its-defrule "3" "\e$(G$$\e(B") (its-defrule "4" "\e$(G$%\e(B")
+ (its-defrule "5" "\e$(G$&\e(B") (its-defrule "6" "\e$(G$'\e(B")
+ (its-defrule "7" "\e$(G$(\e(B") (its-defrule "8" "\e$(G$)\e(B")
+ (its-defrule "9" "\e$(G$*\e(B") (its-defrule "0" "\e$(G$!\e(B")
+ (its-defrule "@" "\e$(G"i\e(B")
+ (its-defrule "#" "\e$(G!l\e(B") (its-defrule "$" "\e$(G"c\e(B")
+ (its-defrule "%" "\e$(G"h\e(B") (its-defrule "^" "\e$(G!T\e(B")
+ (its-defrule "&" "\e$(G!m\e(B") (its-defrule "*" "\e$(G!n\e(B")
+ (its-defrule "(" "\e$(G!>\e(B") (its-defrule ")" "\e$(G!?\e(B")
+ (its-defrule "-" "\e$(G"1\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"0\e(B")
+ (its-defrule "{" "\e$A#{\e(B") (its-defrule "}" "\e$(G!a\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
+ (its-defrule "1" "1") (its-defrule "2" "2")
+ (its-defrule "3" "3") (its-defrule "4" "4")
+ (its-defrule "5" "5") (its-defrule "6" "6")
+ (its-defrule "7" "7") (its-defrule "8" "8")
+ (its-defrule "9" "9") (its-defrule "0" "0")
+ (its-defrule "@" "@")
+ (its-defrule "#" "#") (its-defrule "$" "$")
+ (its-defrule "%" "%") (its-defrule "^" "^")
+ (its-defrule "&" "&") (its-defrule "*" "*")
+ (its-defrule "(" "(") (its-defrule ")" ")")
+ (its-defrule "-" "-") (its-defrule "~" "~")
+ (its-defrule "=" "=") (its-defrule "`" "`")
+ (its-defrule "\\" "\\") (its-defrule "|" "|")
+ (its-defrule "_" "_") (its-defrule "+" "+")
+ (its-defrule "{" "{") (its-defrule "}" "}")
+ (its-defrule "\"" "\"") (its-defrule "'" "'")
+ (its-defrule "<" "<") (its-defrule ">" ">"))))
(provide 'its/pinyin)
(register-input-method
"japanese-egg-wnn" "Japanese" 'egg-activate-wnn
"" "Romaji -> Hiragana -> Kanji&Kana"
- 'its-select-hiragana "Japanese")
+ 'its-select-hiragana)
(register-input-method
"japanese-egg-sj3" "Japanese" 'egg-activate-sj3
"" "Romaji -> Hiragana -> Kanji&Kana"
- 'its-select-hiragana "Japanese")
+ 'its-select-hiragana)
(register-input-method
"chinese-gb-egg-wnn-py" "Chinese-GB" 'egg-activate-wnn
"" "Pinyin -> Simplified Hanzi"
- 'its-select-pinyin-cn "Chinese-GB")
+ 'its-select-pinyin-cn)
(register-input-method
"chinese-gb-egg-wnn-zy" "Chinese-GB" 'egg-activate-wnn
"" "Zhunyin -> Simplified Hanzi"
- 'its-select-zhuyin-cn "Chinese-GB")
+ 'its-select-zhuyin-cn)
(register-input-method
"chinese-cns-egg-wnn-py" "Chinese-CNS" 'egg-activate-wnn
"" "Pinyin -> Traditional Hanzi"
- 'its-select-pinyin-tw "Chinese-CNS")
+ 'its-select-pinyin-tw)
(register-input-method
"chinese-cns-egg-wnn-zy" "Chinese-CNS" 'egg-activate-wnn
"" "Zhunyin -> Traditional Hanzi"
- 'its-select-zhuyin-tw "Chinese-CNS")
+ 'its-select-zhuyin-tw)
(register-input-method
"korean-egg-wnn" "Korean" 'egg-activate-wnn
"" "Hangul -> Hanja"
- 'its-select-hangul "Korean")
+ 'its-select-hangul)
(autoload 'egg-mode "egg" "Toggle EGG mode." t)