From 0ff03a2aa3f12b5ada6a4aee187687973c5bed2a Mon Sep 17 00:00:00 2001 From: tomo Date: Sun, 21 Mar 2004 14:15:44 +0000 Subject: [PATCH] Nabe 0.2. --- ChangeLog | 157 ++++++++++++++++++++++ Makefile | 30 +++++ NABE-CFG | 41 ++++++ NABE-ELS | 11 ++ NABE-MK | 31 +++++ README.ja | 109 ++++++++++++++++ kana-to-roman.el | 385 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ nabe.el | 77 +++++++++++ roman-to-kana.el | 357 ++++++++++++++++++++++++++++++++++++++++++++++++++ skkdic-ext.el | 374 ++++++++++++++++++++++++++++++++++++++++++++++++++++ yude-canna.el | 102 +++++++++++++++ yude-egg.el | 70 ++++++++++ yude-kkc.el | 51 ++++++++ 13 files changed, 1795 insertions(+) create mode 100644 ChangeLog create mode 100644 Makefile create mode 100644 NABE-CFG create mode 100644 NABE-ELS create mode 100644 NABE-MK create mode 100644 README.ja create mode 100644 kana-to-roman.el create mode 100644 nabe.el create mode 100644 roman-to-kana.el create mode 100644 skkdic-ext.el create mode 100644 yude-canna.el create mode 100644 yude-egg.el create mode 100644 yude-kkc.el diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..5c6724a --- /dev/null +++ b/ChangeLog @@ -0,0 +1,157 @@ +1997-09-24 MORIOKA Tomohiko + + * nabe: Version 0.2 was released. + + * README.ja: Modify for nabe. + +Fri Feb 28 04:14:50 1997 Tomohiko Morioka + + * NABE-CFG: Add "../emu" to load-path. + +Fri Feb 28 04:13:30 1997 Tomohiko Morioka + + * NABE-MK: Don't compile and install tl files. + + * NABE-CFG: Don't install tl files. + +Fri Feb 28 02:28:48 1997 Tomohiko Morioka + + * roman-to-kana.el: Don't require tl-str. require cl instead of + tl-list. + + * roman-to-kana.el (roman-to-kana-string-1): Don't use function + `top-string-match'. + +Tue Nov 12 09:20:26 1996 morioka + + * NABE-ELS (nabe-modules): Add `yude-canna'. + +Tue Nov 12 09:18:37 1996 MORIOKA Tomohiko + + * yude-canna.el: require nabe. + + * skkdic-ext.el (skkdic-ext-suffix): Add some words. + + * yude-canna.el: New module. + + * yude-kkc.el: Variable `nabe-kana-to-kanji-function' was renamed + to `nabe-roman-to-kanji-function'. + + * nabe.el (nabe-roman-to-kanji-function): Renamed from + `nabe-kana-to-kanji-function'. + + * yude-kkc.el: Set `roman-to-kana-translate-region' to + `nabe-roman-to-kana-function'. + + * nabe.el (nabe-roman-to-kana-function): New variable. + (nabe-translate-to-hiragana): Use variable + `nabe-roman-to-kana-function'. + +Thu Nov 7 18:04:01 1996 MORIOKA Tomohiko + + * nabe.el (nabe-characters-to-translate): Add `%'. + +Tue Nov 5 22:27:02 1996 MORIOKA Tomohiko + + * roman-to-kana.el (roman-to-kana-string-1): `case-fold-search' + must be nil. + +Fri Nov 1 16:29:49 1996 MORIOKA Tomohiko + + * skkdic-ext.el (skkdic-lookup-key): must treat `len'. + + * skkdic-ext.el (skkdic-lookup-key): Reverse result of + `orig::skkdic-lookup-key'. + +Thu Oct 31 15:04:26 1996 MORIOKA Tomohiko + + * skkdic-ext.el (skkdic-lookup-key): New implementation. + +Wed Oct 16 17:51:36 1996 MORIOKA Tomohiko + + * skkdic-ext.el (skkdic-lookup-key): check already exist; return + reversed result. + + * skkdic-ext.el (sana-prefix): modified. + +Fri Oct 4 14:52:16 1996 MORIOKA Tomohiko + + * kana-to-roman.el, roman-to-kana.el: fixed a typo. + +Fri Oct 4 14:50:28 1996 MORIOKA Tomohiko + + * NABE-ELS: hepburn.el was abolished. + +Fri Oct 4 14:49:37 1996 MORIOKA Tomohiko + + * roman-to-kana.el: hepburn.el was merged to roman-to-kana.el. + +Fri Oct 4 14:48:08 1996 MORIOKA Tomohiko + + * kana-to-roman.el: New module. + +Fri Oct 4 14:15:02 1996 MORIOKA Tomohiko + + * Makefile: mk-yk was renamed to NABE-MK. + + * NABE-MK: renamed from mk-yk. + + * NABE-ELS (nabe-modules): Add nabe.el and skkdic-ext.el. + +Fri Oct 4 14:09:15 1996 MORIOKA Tomohiko + + * NABE-ELS: renamed from YK-ELS. + +Fri Oct 4 14:07:15 1996 MORIOKA Tomohiko + + * NABE-CFG: renamed from YK-CFG. + + * skkdic-ext.el: New module. + +Fri Oct 4 13:47:24 1996 MORIOKA Tomohiko + + * yude-kkc.el: Use nabe.el. + + * nabe.el: New module. + +Fri Sep 27 13:20:21 1996 MORIOKA Tomohiko + + * hepburn.el (hepburn-roman-to-kana-translation-rule-alist): + fixed a typo. + +Wed Sep 25 00:47:55 1996 MORIOKA Tomohiko + + * yude-kkc.el (kkc-boiled-charset): Add `;'. + + (yude-kkc-translate-to-kanji, yude-kkc-translate-to-hiragana): + Call `auto-fill-function' if it is not nil. + + +Wed Sep 18 10:05:41 1996 MORIOKA Tomohiko + + * tl: Version 7.61.5 was released. + * yude-kkc: Version 0.1 was released. + + * README.ja: New file. + +Wed Sep 18 09:38:02 1996 MORIOKA Tomohiko + + * hepburn.el (hepburn-roman-to-kana-translation-rule-alist): add + `my', `mmy', `ry' and `rry' line. + + * hepburn.el (hepburn-roman-to-kana-translation-rule-alist): add + symbols. + + * Makefile: Use `PREFIX' instead of `DIR'. + + * mk-yk: use YK-CFG file. + + * YK-CFG, mk-yk, Makefile, YK-ELS, jamato.el, yude-kkc.el: + New file. + +Tue Sep 17 06:23:11 1996 MORIOKA Tomohiko + + * hepburn.el (hepburn-roman-to-kana-translation-rule-alist): add + rule to translate "(" and ")" to JIS X0208. + + * hepburn.el, roman-to-kana.el: New file. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e2a1d1 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +# +# $Id: Makefile,v 0.3 1996/10/04 14:15:02 morioka Exp morioka $ +# + +EMACS = emacs +FLAGS = -batch -q -no-site-file -l NABE-MK + +PREFIX = + +FILES = README.?? Makefile NABE-* *.el ChangeLog + +VERSION = 0.2 + + +elc: + $(EMACS) $(FLAGS) -f compile-nabe + +install: elc + $(EMACS) $(FLAGS) -f install-nabe $(PREFIX) + + +clean: + -rm *.elc + + +tar: + -(cd /tmp ; mkdir nabe-$(VERSION)) + cp $(FILES) /tmp/nabe-$(VERSION) + cd /tmp; tar cvzf nabe-$(VERSION).tar.gz nabe-$(VERSION) + rm -rf /tmp/nabe-$(VERSION) diff --git a/NABE-CFG b/NABE-CFG new file mode 100644 index 0000000..7db4b96 --- /dev/null +++ b/NABE-CFG @@ -0,0 +1,41 @@ +;;; -*-Emacs-Lisp-*- +;;; +;;; $Id: NABE-CFG,v 0.4 1997/02/28 04:14:50 tmorioka Exp morioka $ +;;; + +(setq load-path (append + (mapcar (function + (lambda (path) + (expand-file-name path (getenv "PWD")) + )) + '("." "../apel" "../emu") + ) + load-path)) + +(require 'install) + + +;;; @ Please specify prefix of install directory. +;;; + +;; Please specify install path prefix. +;; If it is omitted, shared directory (maybe /usr/local is used). +(defvar PREFIX install-prefix) +;;(setq PREFIX "~/") + +;; Please specify prefix for ``nabe'' [optional] +(setq NABE_PREFIX "nabe") + + + +;;; @ optional settings +;;; + +;; It is generated by automatically. Please set variable `PREFIX'. +;; If you don't like default directory tree, please set it. +(defvar LISPDIR (install-detect-elisp-directory PREFIX)) +;; (setq install-default-elisp-directory "~/lib/emacs/lisp") + +(setq NABE_DIR (expand-file-name NABE_PREFIX LISPDIR)) + +;;; NABE-CFG ends here diff --git a/NABE-ELS b/NABE-ELS new file mode 100644 index 0000000..9ccb0bb --- /dev/null +++ b/NABE-ELS @@ -0,0 +1,11 @@ +;;; -*-Emacs-Lisp-*- +;;; +;;; $Id: NABE-ELS,v 0.5 1996/11/12 09:20:26 morioka Exp morioka $ +;;; + +(setq nabe-modules + '(roman-to-kana kana-to-roman + nabe yude-kkc yude-canna yude-egg + skkdic-ext)) + +;;; NABE-ELS ends here diff --git a/NABE-MK b/NABE-MK new file mode 100644 index 0000000..a9b24da --- /dev/null +++ b/NABE-MK @@ -0,0 +1,31 @@ +;;; -*-Emacs-Lisp-*- +;;; +;;; $Id: NABE-MK,v 0.4 1997/02/28 04:13:30 tmorioka Exp $ +;;; + +(defun config-nabe () + (let (prefix) + (setq prefix (car command-line-args-left)) + (and prefix + (not (string-equal "NONE" prefix)) + (progn + (defvar PREFIX prefix) + (setq command-line-args-left (cdr command-line-args-left)) + )) + (load-file "NABE-CFG") + (load-file "NABE-ELS") + (princ (format "PREFIX=%s\n" PREFIX)) + )) + +(defun compile-nabe () + (config-nabe) + (require 'roman-to-kana) + (compile-elisp-modules nabe-modules ".") + ) + +(defun install-nabe () + (config-nabe) + (install-elisp-modules nabe-modules "./" NABE_DIR) + ) + +;;; NABE-MK ends here diff --git a/README.ja b/README.ja new file mode 100644 index 0000000..94471f9 --- /dev/null +++ b/README.ja @@ -0,0 +1,109 @@ +『なべの使い方』 +by 守岡 知彦 +$Id: README.ja,v 0.2 1997/09/24 14:03:55 morioka Exp $ + +1. 『なべ』とは + + 『なべ』は kkc, かんな、たまごっちぃ等の入力法を使って「ゆでたまご」 +風の日本語入力を実現するための package です。なお、これを使うには APEL +package が必要です。APEL は + + ftp://ftp.jaist.ac.jp/pub/GNU/elisp/apel/ + +から入手可能です。APEL の README.en を見て APEL を install しておいて +下さい。 + + +2. Install + +2.1 compile + + % make + + emacs の実行 file 名が `emacs' と異なる場合は、 + + % make EMACS=emacs20 + +のようにしてください。 + + +2.2 install + +2.2.1 展開した場所に install する場合 + + compile するだけで OK です。 + + +2.2.2 site-lisp に install する場合 + + % make install + +としてください。 + + emacs の実行 file 名が `emacs' と異なる場合は、compile の場合と同様 +に + + % make install EMACS=emacs20 + +と `EMACS=' を使って実行 file 名を指定してください。 + + +2.2.3 home の下に install する場合 + + % make install PREFIX=~/ + +としてください。 + + emacs の実行 file 名が `emacs' と異なる場合は、前節の場合と同様に +`EMACS=' を使って実行 file 名を指定してください。 + + +3. 設定 + +3.1 yude-kkc + + ~/.emacs に + +(require 'file-detect) +(add-path "nabe") +(require 'yude-kkc) + +を入れてください。 + + +3.2 yude-canna + + ~/.emacs に + +(require 'file-detect) +(add-path "nabe") +(require 'yude-canna) + +を入れてください。 + + +3.3 yude-egg + +(require 'file-detect) +(add-path "nabe") +(require 'yude-egg) + + +3.4 共通の設定 + + 標準では + + 漢字への変換 M-SPC + かなへの変換 M-j + +となっていますが、それぞれ、(yude-* が load される前に)変数 + + nabe-kanji-key + nabe-hiragana-key + +を設定することで変更することができます。 + + また、標準ではヘボン式もどきのローマ字かな変換表を用いていますが、 +hepburn.el を参考にお好みの変換表を作ってください。変数 +roman-to-kana-translate-table に module 名を指定することでヘボン式以外 +の変換表を用いることができます。 diff --git a/kana-to-roman.el b/kana-to-roman.el new file mode 100644 index 0000000..8b08f2d --- /dev/null +++ b/kana-to-roman.el @@ -0,0 +1,385 @@ +;;; kana-to-roman.el --- Kana to Roman converter + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: kana-to-roman.el,v 0.4 1996/10/04 14:52:16 morioka Exp $ +;; Keywords: Roman-to-Kana, input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'roman-to-kana) + +;; (npp +;; (sort (mapcar (lambda (cell) +;; (cons (cdr cell)(car cell)) +;; ) +;; hepburn-roman-to-kana-translation-rule-alist) +;; (lambda (c1 c2) +;; (string< (car c2)(car c1)) +;; ))) + +(defvar kana-to-roman-translate-table 'hepburn) + +(defvar hepburn-kana-to-roman-translation-rule-alist + '(("ヴぉ" . "vo") + ("ヴぇ" . "ve") + ("ヴぃ" . "vi") + ("ヴぁ" . "va") + ("ヴ" . "vu") + ("んの" . "nno") + ("んね" . "nne") + ("んぬ" . "nnu") + ("んに" . "nni") + ("んな" . "nna") + ("ん" . "n") + ;;("ん" . "x") + ;;("ん" . "n'") + ("を" . "wo") + ("ゑ" . "we") + ("ゐ" . "wi") + ("わ" . "wa") + ("ろ" . "ro") + ("れ" . "re") + ("る" . "ru") + ("りょ" . "ryo") + ("りゅ" . "ryu") + ("りゃ" . "rya") + ("りぇ" . "rye") + ("りぃ" . "ryi") + ("り" . "ri") + ("ら" . "ra") + ("よ" . "yo") + ("ゆ" . "yu") + ("や" . "ya") + ("も" . "mo") + ("め" . "me") + ("む" . "mu") + ("みょ" . "myo") + ("みゅ" . "myu") + ("みゃ" . "mya") + ("みぇ" . "mye") + ("みぃ" . "myi") + ("み" . "mi") + ("ま" . "ma") + ("ぽ" . "po") + ("ぼ" . "bo") + ("ほ" . "ho") + ("ぺ" . "pe") + ("べ" . "be") + ("へ" . "he") + ("ぷぉ" . "pfo") + ("ぷぇ" . "pfe") + ("ぷぃ" . "pfi") + ("ぷぁ" . "pfa") + ("ぷ" . "pu") + ("ぶ" . "bu") + ("ふぉ" . "fo") + ("ふぇ" . "fe") + ("ふぃ" . "fi") + ("ふぁ" . "fa") + ("ふ" . "fu") + ("ぴょ" . "pyo") + ("ぴゅ" . "pyu") + ("ぴゃ" . "pya") + ("ぴぇ" . "pye") + ("ぴぃ" . "pyi") + ("ぴ" . "pi") + ("びょ" . "byo") + ("びゅ" . "byu") + ("びゃ" . "bya") + ("びぇ" . "bye") + ("びぃ" . "byi") + ("び" . "bi") + ("ひょ" . "hyo") + ("ひゅ" . "hyu") + ("ひゃ" . "hya") + ("ひぇ" . "hye") + ("ひぃ" . "hyi") + ("ひ" . "hi") + ("ぱ" . "pa") + ("ば" . "ba") + ("は" . "ha") + ("の" . "no") + ("ね" . "ne") + ("ぬ" . "nu") + ("にょ" . "nyo") + ("にゅ" . "nyu") + ("にゃ" . "nya") + ("にぇ" . "nye") + ("にぃ" . "nyi") + ("に" . "ni") + ("な" . "na") + ("ど" . "do") + ("とぅ" . "tu") + ("と" . "to") + ("でぃ" . "di") + ("で" . "de") + ("てぃ" . "ti") + ("て" . "te") + ("づぉ" . "dzo") + ("づぇ" . "dze") + ("づぃ" . "dzi") + ("づぁ" . "dza") + ("づ" . "dzu") + ("つぉ" . "tso") + ("つぇ" . "tse") + ("つぃ" . "tsi") + ("つぁ" . "tsa") + ("つ" . "tsu") + ("っヴぉ" . "vvo") + ("っヴぇ" . "vve") + ("っヴぃ" . "vvi") + ("っヴぁ" . "vva") + ("っヴ" . "vvu") + ("っを" . "wwo") + ("っゑ" . "wwe") + ("っゐ" . "wwi") + ("っわ" . "wwa") + ("っろ" . "rro") + ("っれ" . "rre") + ("っる" . "rru") + ("っりょ" . "rryo") + ("っりゅ" . "rryu") + ("っりゃ" . "rrya") + ("っりぇ" . "rrye") + ("っりぃ" . "rryi") + ("っり" . "rri") + ("っら" . "rra") + ("っよ" . "yyo") + ("っゆ" . "yyu") + ("っや" . "yya") + ("っも" . "mmo") + ("っめ" . "mme") + ("っむ" . "mmu") + ("っみょ" . "mmyo") + ("っみゅ" . "mmyu") + ("っみゃ" . "mmya") + ("っみぇ" . "mmye") + ("っみぃ" . "mmyi") + ("っみ" . "mmi") + ("っま" . "mma") + ("っぽ" . "ppo") + ("っぼ" . "bbo") + ("っほ" . "hho") + ("っぺ" . "ppe") + ("っべ" . "bbe") + ("っへ" . "hhe") + ("っぷぉ" . "ppfo") + ("っぷぇ" . "ppfe") + ("っぷぃ" . "ppfi") + ("っぷぁ" . "ppfa") + ("っぷ" . "ppu") + ("っぶ" . "bbu") + ("っふぉ" . "ffo") + ("っふぇ" . "ffe") + ("っふぃ" . "ffi") + ("っふぁ" . "ffa") + ("っふ" . "ffu") + ("っぴょ" . "ppyo") + ("っぴゅ" . "ppyu") + ("っぴゃ" . "ppya") + ("っぴぇ" . "ppye") + ("っぴぃ" . "ppyi") + ("っぴ" . "ppi") + ("っびょ" . "bbyo") + ("っびゅ" . "bbyu") + ("っびゃ" . "bbya") + ("っびぇ" . "bbye") + ("っびぃ" . "bbyi") + ("っび" . "bbi") + ("っひょ" . "hhyo") + ("っひゅ" . "hhyu") + ("っひゃ" . "hhya") + ("っひぇ" . "hhye") + ("っひぃ" . "hhyi") + ("っひ" . "hhi") + ("っぱ" . "ppa") + ("っば" . "bba") + ("っは" . "hha") + ("っにょ" . "nnyo") + ("っにゅ" . "nnyu") + ("っにゃ" . "nnya") + ("っにぇ" . "nnye") + ("っにぃ" . "nnyi") + ("っど" . "ddo") + ("っとぅ" . "ttu") + ("っと" . "tto") + ("っでぃ" . "ddi") + ("っで" . "dde") + ("ってぃ" . "tti") + ("って" . "tte") + ("っづぉ" . "ddzo") + ("っづぇ" . "ddze") + ("っづぃ" . "ddzi") + ("っづぁ" . "ddza") + ("っづ" . "ddzu") + ("っつぉ" . "ttso") + ("っつぇ" . "ttse") + ("っつぃ" . "ttsi") + ("っつぁ" . "ttsa") + ("っつ" . "ttsu") + ("っぢょ" . "ddjo") + ("っぢゅ" . "ddju") + ("っぢゃ" . "ddja") + ("っぢぇ" . "ddje") + ("っぢ" . "ddji") + ("っちょ" . "ccho") + ("っちゅ" . "cchu") + ("っちゃ" . "ccha") + ("っちぇ" . "cche") + ("っち" . "cchi") + ("っだ" . "dda") + ("った" . "tta") + ("っぞ" . "zzo") + ("っそ" . "sso") + ("っぜ" . "zze") + ("っせ" . "sse") + ("っず" . "zzu") + ("っす" . "ssu") + ("っじょ" . "jjo") + ("っじゅ" . "jju") + ("っじゃ" . "jja") + ("っじぇ" . "jje") + ("っじ" . "zzi") + ("っじ" . "jji") + ("っしょ" . "ssho") + ("っしゅ" . "sshu") + ("っしゃ" . "ssha") + ("っしぇ" . "sshe") + ("っし" . "sshi") + ("っざ" . "zza") + ("っさ" . "ssa") + ("っご" . "ggo") + ("っこ" . "kko") + ("っげ" . "gge") + ("っけ" . "kke") + ("っぐ" . "ggu") + ("っく" . "kku") + ("っぎょ" . "ggyo") + ("っぎゅ" . "ggyu") + ("っぎゃ" . "ggya") + ("っぎぇ" . "ggye") + ("っぎぃ" . "ggyi") + ("っぎ" . "ggi") + ("っきょ" . "kkyo") + ("っきゅ" . "kkyu") + ("っきゃ" . "kkya") + ("っきぇ" . "kkye") + ("っきぃ" . "kkyi") + ("っき" . "kki") + ("っが" . "gga") + ("っか" . "kka") + ("っう" . "wwu") + ("っいぇ" . "yye") + ("っい" . "yyi") + ("っ" . "q") + ("ぢょ" . "djo") + ("ぢゅ" . "dju") + ("ぢゃ" . "dja") + ("ぢぇ" . "dje") + ("ぢ" . "dji") + ("ちょ" . "cho") + ("ちゅ" . "chu") + ("ちゃ" . "cha") + ("ちぇ" . "che") + ("ち" . "chi") + ("だ" . "da") + ("た" . "ta") + ("ぞ" . "zo") + ("そ" . "so") + ("ぜ" . "ze") + ("せ" . "se") + ("ず" . "zu") + ("す" . "su") + ("じょ" . "jo") + ("じゅ" . "ju") + ("じゃ" . "ja") + ("じぇ" . "je") + ("じ" . "zi") + ("じ" . "ji") + ("しょ" . "sho") + ("しゅ" . "shu") + ("しゃ" . "sha") + ("しぇ" . "she") + ("し" . "shi") + ("ざ" . "za") + ("さ" . "sa") + ("ご" . "go") + ("こ" . "ko") + ("げ" . "ge") + ("け" . "ke") + ("ぐ" . "gu") + ("く" . "ku") + ("ぎょ" . "gyo") + ("ぎゅ" . "gyu") + ("ぎゃ" . "gya") + ("ぎぇ" . "gye") + ("ぎぃ" . "gyi") + ("ぎ" . "gi") + ("きょ" . "kyo") + ("きゅ" . "kyu") + ("きゃ" . "kya") + ("きぇ" . "kye") + ("きぃ" . "kyi") + ("き" . "ki") + ("が" . "ga") + ("か" . "ka") + ("お" . "o") + ("え" . "e") + ("う" . "u") + ("いぇ" . "ye") + ("い" . "i") + ("あ" . "a") + )) + +(defun hiragana-to-roman-translate-string (str &optional table) + (or table + (setq table (symbol-value + (intern (concat + (symbol-name kana-to-roman-translate-table) + "-kana-to-roman-translation-rule-alist")) + ))) + (let (ret dest) + (while (setq ret (roman-to-kana-string-1 str table)) + (setq dest (concat dest (car ret))) + (setq str (cdr ret)) + ) + (concat dest str) + )) + +(defun hiragana-to-roman-translate-region (start end) + (save-excursion + (let ((str (buffer-substring start end))) + (delete-region start end) + (goto-char start) + (insert (hiragana-to-roman-translate-string str)) + ))) + + +;;; @ end +;;; + +(provide 'kana-to-roman) + +(run-hooks 'kana-to-roman-load-hook) + +;;; kana-to-roman.el ends here diff --git a/nabe.el b/nabe.el new file mode 100644 index 0000000..0da8dea --- /dev/null +++ b/nabe.el @@ -0,0 +1,77 @@ +;;; nabe.el --- Boiled-Egg like roman to kanaji converter kernel + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: nabe.el,v 0.5 1996/11/12 09:03:23 morioka Exp $ +;; Keywords: input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(defvar nabe-characters-to-translate "-a-zA-Z0-9.,?!~()[]#@/:;%" + "*characters to transfer. [nabe.el]") + +(defvar nabe-kanji-key "\e ") +(defvar nabe-hiragana-key "\en") + +(defvar nabe-roman-to-kanji-function nil) +(defvar nabe-roman-to-kana-function nil) + +(global-set-key nabe-kanji-key 'nabe-translate-to-kanji) +(global-set-key nabe-hiragana-key 'nabe-translate-to-hiragana) + +(defun nabe-translate-to-kanji (arg) + (interactive "p") + (let ((po (point)) (mark (or (mark t) 0))) + (skip-chars-backward nabe-characters-to-translate) + (if (and mark (< mark po) (< (point) mark)) + (goto-char mark) + ) + (if (not (eq (point) po)) + (funcall nabe-roman-to-kanji-function (point) po) + ) + (and auto-fill-function (funcall auto-fill-function)) + )) + +(defun nabe-translate-to-hiragana (arg) + (interactive "p") + (let ((po (point)) (mark (or (mark t) 0))) + (skip-chars-backward nabe-characters-to-translate) + (if (and mark (< mark po) (< (point) mark)) + (goto-char mark) + ) + (if (not (eq (point) po)) + (save-restriction + (narrow-to-region (point) po) + (funcall nabe-roman-to-kana-function (point) po) + (goto-char (point-max)) + )) + (and auto-fill-function (funcall auto-fill-function)) + )) + + +;;; @ end +;;; + +(provide 'nabe) + +(run-hooks 'nabe-load-hook) + +;;; nabe.el ends here diff --git a/roman-to-kana.el b/roman-to-kana.el new file mode 100644 index 0000000..129f8ee --- /dev/null +++ b/roman-to-kana.el @@ -0,0 +1,357 @@ +;;; roman-to-kana.el --- Roman to Kana converter + +;; Copyright (C) 1996,1997 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: roman-to-kana.el,v 0.7 1997/02/28 02:28:48 tmorioka Exp $ +;; Keywords: Roman-to-Kana, input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'cl) + +(defvar roman-to-kana-translate-table 'hepburn) + +(defvar hepburn-roman-to-kana-translation-rule-alist + '(("a" . "あ") + ("i" . "い") + ("u" . "う") + ("e" . "え") + ("o" . "お") + + ("ka" . "か")("kka" . "っか") + ("ki" . "き")("kki" . "っき") + ("ku" . "く")("kku" . "っく") + ("ke" . "け")("kke" . "っけ") + ("ko" . "こ")("kko" . "っこ") + + ("ga" . "が")("gga" . "っが") + ("gi" . "ぎ")("ggi" . "っぎ") + ("gu" . "ぐ")("ggu" . "っぐ") + ("ge" . "げ")("gge" . "っげ") + ("go" . "ご")("ggo" . "っご") + + ("kya" . "きゃ")("kkya" . "っきゃ") + ("kyi" . "きぃ")("kkyi" . "っきぃ") + ("kyu" . "きゅ")("kkyu" . "っきゅ") + ("kye" . "きぇ")("kkye" . "っきぇ") + ("kyo" . "きょ")("kkyo" . "っきょ") + + ("gya" . "ぎゃ")("ggya" . "っぎゃ") + ("gyi" . "ぎぃ")("ggyi" . "っぎぃ") + ("gyu" . "ぎゅ")("ggyu" . "っぎゅ") + ("gye" . "ぎぇ")("ggye" . "っぎぇ") + ("gyo" . "ぎょ")("ggyo" . "っぎょ") + + ("sa" . "さ")("ssa" . "っさ") + ("si" . "し")("ssi" . "っし") + ("su" . "す")("ssu" . "っす") + ("se" . "せ")("sse" . "っせ") + ("so" . "そ")("sso" . "っそ") + + ("za" . "ざ")("zza" . "っざ") + ("zi" . "じ")("zzi" . "っじ") + ("zu" . "ず")("zzu" . "っず") + ("ze" . "ぜ")("zze" . "っぜ") + ("zo" . "ぞ")("zzo" . "っぞ") + + ("sha" . "しゃ")("ssha" . "っしゃ") + ("shi" . "し") ("sshi" . "っし") + ("shu" . "しゅ")("sshu" . "っしゅ") + ("she" . "しぇ")("sshe" . "っしぇ") + ("sho" . "しょ")("ssho" . "っしょ") + + ("ja" . "じゃ")("jja" . "っじゃ") + ("ji" . "じ") ("jji" . "っじ") + ("ju" . "じゅ")("jju" . "っじゅ") + ("je" . "じぇ")("jje" . "っじぇ") + ("jo" . "じょ")("jjo" . "っじょ") + + ("ta" . "た") ("tta" . "った") + ("ti" . "てぃ")("tti" . "ってぃ") + ("tu" . "とぅ")("ttu" . "っとぅ") + ("te" . "て") ("tte" . "って") + ("to" . "と") ("tto" . "っと") + + ("da" . "だ") ("dda" . "っだ") + ("di" . "でぃ")("ddi" . "っでぃ") + ("du" . "づ") ("ddu" . "っづ") + ("de" . "で") ("dde" . "っで") + ("do" . "ど") ("ddo" . "っど") + + ("tsa" . "つぁ")("ttsa" . "っつぁ") + ("tsi" . "つぃ")("ttsi" . "っつぃ") + ("tsu" . "つ") ("ttsu" . "っつ") + ("tse" . "つぇ")("ttse" . "っつぇ") + ("tso" . "つぉ")("ttso" . "っつぉ") + + ("dza" . "づぁ")("ddza" . "っづぁ") + ("dzi" . "づぃ")("ddzi" . "っづぃ") + ("dzu" . "づ") ("ddzu" . "っづ") + ("dze" . "づぇ")("ddze" . "っづぇ") + ("dzo" . "づぉ")("ddzo" . "っづぉ") + + ("cha" . "ちゃ")("ccha" . "っちゃ") + ("chi" . "ち") ("cchi" . "っち") + ("chu" . "ちゅ")("cchu" . "っちゅ") + ("che" . "ちぇ")("cche" . "っちぇ") + ("cho" . "ちょ")("ccho" . "っちょ") + + ("dja" . "ぢゃ")("ddja" . "っぢゃ") + ("dji" . "ぢ") ("ddji" . "っぢ") + ("dju" . "ぢゅ")("ddju" . "っぢゅ") + ("dje" . "ぢぇ")("ddje" . "っぢぇ") + ("djo" . "ぢょ")("ddjo" . "っぢょ") + + ("na" . "な")("nna" . "んな") + ("ni" . "に")("nni" . "んに") + ("nu" . "ぬ")("nnu" . "んぬ") + ("ne" . "ね")("nne" . "んね") + ("no" . "の")("nno" . "んの") + + ("nya" . "にゃ")("nnya" . "っにゃ") + ("nyi" . "にぃ")("nnyi" . "っにぃ") + ("nyu" . "にゅ")("nnyu" . "っにゅ") + ("nye" . "にぇ")("nnye" . "っにぇ") + ("nyo" . "にょ")("nnyo" . "っにょ") + + ("ha" . "は")("hha" . "っは") + ("hi" . "ひ")("hhi" . "っひ") + ("hu" . "ふ")("hhu" . "っふ") + ("he" . "へ")("hhe" . "っへ") + ("ho" . "ほ")("hho" . "っほ") + + ("pa" . "ぱ")("ppa" . "っぱ") + ("pi" . "ぴ")("ppi" . "っぴ") + ("pu" . "ぷ")("ppu" . "っぷ") + ("pe" . "ぺ")("ppe" . "っぺ") + ("po" . "ぽ")("ppo" . "っぽ") + + ("ba" . "ば")("bba" . "っば") + ("bi" . "び")("bbi" . "っび") + ("bu" . "ぶ")("bbu" . "っぶ") + ("be" . "べ")("bbe" . "っべ") + ("bo" . "ぼ")("bbo" . "っぼ") + + ("hya" . "ひゃ")("hhya" . "っひゃ") + ("hyi" . "ひぃ")("hhyi" . "っひぃ") + ("hyu" . "ひゅ")("hhyu" . "っひゅ") + ("hye" . "ひぇ")("hhye" . "っひぇ") + ("hyo" . "ひょ")("hhyo" . "っひょ") + + ("pya" . "ぴゃ")("ppya" . "っぴゃ") + ("pyi" . "ぴぃ")("ppyi" . "っぴぃ") + ("pyu" . "ぴゅ")("ppyu" . "っぴゅ") + ("pye" . "ぴぇ")("ppye" . "っぴぇ") + ("pyo" . "ぴょ")("ppyo" . "っぴょ") + + ("bya" . "びゃ")("bbya" . "っびゃ") + ("byi" . "びぃ")("bbyi" . "っびぃ") + ("byu" . "びゅ")("bbyu" . "っびゅ") + ("bye" . "びぇ")("bbye" . "っびぇ") + ("byo" . "びょ")("bbyo" . "っびょ") + + ("fa" . "ふぁ")("ffa" . "っふぁ") + ("fi" . "ふぃ")("ffi" . "っふぃ") + ("fu" . "ふ") ("ffu" . "っふ") + ("fe" . "ふぇ")("ffe" . "っふぇ") + ("fo" . "ふぉ")("ffo" . "っふぉ") + + ("pfa" . "ぷぁ")("ppfa" . "っぷぁ") + ("pfi" . "ぷぃ")("ppfi" . "っぷぃ") + ("pfu" . "ぷ") ("ppfu" . "っぷ") + ("pfe" . "ぷぇ")("ppfe" . "っぷぇ") + ("pfo" . "ぷぉ")("ppfo" . "っぷぉ") + + ("va" . "ヴぁ")("vva" . "っヴぁ") + ("vi" . "ヴぃ")("vvi" . "っヴぃ") + ("vu" . "ヴ") ("vvu" . "っヴ") + ("ve" . "ヴぇ")("vve" . "っヴぇ") + ("vo" . "ヴぉ")("vvo" . "っヴぉ") + + ("ma" . "ま")("mma" . "っま") + ("mi" . "み")("mmi" . "っみ") + ("mu" . "む")("mmu" . "っむ") + ("me" . "め")("mme" . "っめ") + ("mo" . "も")("mmo" . "っも") + + ("mya" . "みゃ")("mmya" . "っみゃ") + ("myi" . "みぃ")("mmyi" . "っみぃ") + ("myu" . "みゅ")("mmyu" . "っみゅ") + ("mye" . "みぇ")("mmye" . "っみぇ") + ("myo" . "みょ")("mmyo" . "っみょ") + + ("ya" . "や") ("yya" . "っや") + ("yi" . "い") ("yyi" . "っい") + ("yu" . "ゆ") ("yyu" . "っゆ") + ("ye" . "いぇ")("yye" . "っいぇ") + ("yo" . "よ") ("yyo" . "っよ") + + ("ra" . "ら")("rra" . "っら") + ("ri" . "り")("rri" . "っり") + ("ru" . "る")("rru" . "っる") + ("re" . "れ")("rre" . "っれ") + ("ro" . "ろ")("rro" . "っろ") + + ("rya" . "りゃ")("rrya" . "っりゃ") + ("ryi" . "りぃ")("rryi" . "っりぃ") + ("ryu" . "りゅ")("rryu" . "っりゅ") + ("rye" . "りぇ")("rrye" . "っりぇ") + ("ryo" . "りょ")("rryo" . "っりょ") + + ("wa" . "わ")("wwa" . "っわ") + ("wi" . "ゐ")("wwi" . "っゐ") + ("wu" . "う")("wwu" . "っう") + ("we" . "ゑ")("wwe" . "っゑ") + ("wo" . "を")("wwo" . "っを") + + ("n'" . "ん") + ("n" . "ん") + ("x" . "ん") + ("q" . "っ") + + ("1" . "1") ("2" . "2") ("3" . "3") ("4" . "4") ("5" . "5") + ("6" . "6") ("7" . "7") ("8" . "8") ("9" . "9") ("0" . "0") + + ("!" . "!") ("@" . "@") ("#" . "#") ("$" . "$") ("%" . "%") + ("^" . "^") ("&" . "&") ("*" . "*") ("(" . "(") (")" . ")") + ("-" . "ー") ("=" . "=") ("`" . "`") ("\\" . "\")("|" . "|") + ("_" . "_") ("+" . "+") ("~" . " ̄") ("[" . "「") ("]" . "」") + ("{" . "{") ("}" . "}") (":" . ":") (";" . ";") ("\"" . "”") + ("'" . "’") ("." . "。") ("," . "、") ("<" . "<") (">" . ">") + ("?" . "?") ("/" . "/") + + ("z1" . "○") ("z!" . "●") + ("z2" . "▽") ("z@" . "▼") + ("z3" . "△") ("z#" . "▲") + ("z4" . "□") ("z$" . "■") + ("z5" . "◇") ("z%" . "◆") + ("z6" . "☆") ("z^" . "★") + ("z7" . "◎") ("z&" . "£") + ("z8" . "¢") ("z*" . "×") + ("z9" . "♂") ("z(" . "【") + ("z0" . "♀") ("z)" . "】") + ("z-" . "〜") ("z_" . "∴") + ("z=" . "≠") ("z+" . "±") + ("z\\" . "¥")("z|" . "‖") + ("z`" . "´") ("z~" . "¨") + + ("zq" . "《") ("zQ" . "〈") + ("zw" . "》") ("zW" . "〉") + ("zr" . "々") ("zR" . "仝") + ("zt" . "〆") ("zT" . "§") + ("zp" . "〒") ("zP" . "↑") + ("z[" . "『") ("z{" . "〔") + ("z]" . "』") ("z}" . "〕") + + ("zs" . "ヽ") ("zS" . "ヾ") + ("zd" . "ゝ") ("zD" . "ゞ") + ("zf" . "〃") ("zF" . "→") + ("zg" . "‐") ("zG" . "―") + ("zh" . "←") + ("zj" . "↓") + ("zk" . "↑") + ("zl" . "→") + ("z;" . "゛") ("z:" . "゜") + ("z\'" . "‘")("z\"" . "“") + + ("zx" . ":-") ("zX" . ":-)") + ("zc" . "〇") ("zC" . "℃") + ("zv" . "※") ("zV" . "÷") + ("zb" . "°") ("zB" . "←") + ("zn" . "′") ("zN" . "↓") + ("zm" . "″") ("zM" . "〓") + ("z," . "‥") ("z<" . "≦") + ("z." . "…") ("z>" . "≧") + ("z/" . "・") ("z?" . "∞") + + ("Z " . " ") ("Z!" . "!") ("Z\"" . "″") ("Z#" . "#") + ("Z$" . "$") ("Z%" . "%") ("Z&" . "&") ("Z'" . "′") + ("Z(" . "(") ("Z)" . ")") ("Z*" . "*") ("Z+" . "+") + ("Z," . ",") ("Z-" . "−") ("Z." . ".") ("Z/" . "/") + ("Z0" . "0") ("Z1" . "1") ("Z2" . "2") ("Z3" . "3") + ("Z4" . "4") ("Z5" . "5") ("Z6" . "6") ("Z7" . "7") + ("Z8" . "8") ("Z9" . "9") ("Z:" . ":") ("Z;" . ";") + ("Z<" . "<") ("Z=" . "=") ("Z>" . ">") ("Z?" . "?") + ("Z@" . "@") ("ZA" . "A") ("ZB" . "B") ("ZC" . "C") + ("ZD" . "D") ("ZE" . "E") ("ZF" . "F") ("ZG" . "G") + ("ZH" . "H") ("ZI" . "I") ("ZJ" . "J") ("ZK" . "K") + ("ZL" . "L") ("ZM" . "M") ("ZN" . "N") ("ZO" . "O") + ("ZP" . "P") ("ZQ" . "Q") ("ZR" . "R") ("ZS" . "S") + ("ZT" . "T") ("ZU" . "U") ("ZV" . "V") ("ZW" . "W") + ("ZX" . "X") ("ZY" . "Y") ("ZZ" . "Z") ("Z[" . "[") + ("Z\\" . "\")("Z]" . "]") ("Z^" . "^") ("Z_" . "_") + ("Z`" . "‘") ("Za" . "a") ("Zb" . "b") ("Zc" . "c") + ("Zd" . "d") ("Ze" . "e") ("Zf" . "f") ("Zg" . "g") + ("Zh" . "h") ("Zi" . "i") ("Zj" . "j") ("Zk" . "k") + ("Zl" . "l") ("Zm" . "m") ("Zn" . "n") ("Zo" . "o") + ("Zp" . "p") ("Zq" . "q") ("Zr" . "r") ("Zs" . "s") + ("Zt" . "t") ("Zu" . "u") ("Zv" . "v") ("Zw" . "w") + ("Zx" . "x") ("Zy" . "y") ("Zz" . "z") ("Z{" . "{") + ("Z|" . "|") ("Z}" . "}") ("Z~" . "〜") + )) + +(defun roman-to-kana-string-1 (str table) + (let* (case-fold-search + (ret + (find-if (function + (lambda (rule) + (string-match (concat "^" (regexp-quote (car rule))) + str) + )) + table))) + (if ret + (cons (cdr ret)(substring str (match-end 0))) + ) + )) + +(defun roman-to-kana-translate-string (str &optional table) + (or table + (setq table (symbol-value + (intern (concat + (symbol-name roman-to-kana-translate-table) + "-roman-to-kana-translation-rule-alist")) + ))) + (let (ret dest) + (while (setq ret (roman-to-kana-string-1 str table)) + (setq dest (concat dest (car ret))) + (setq str (cdr ret)) + ) + (concat dest str) + )) + +(defun roman-to-kana-translate-region (start end) + (save-excursion + (let ((str (buffer-substring start end))) + (delete-region start end) + (goto-char start) + (insert (roman-to-kana-translate-string str)) + ))) + + +;;; @ end +;;; + +(provide 'roman-to-kana) + +(run-hooks 'roman-to-kana-load-hook) + +;;; roman-to-kana.el ends here diff --git a/skkdic-ext.el b/skkdic-ext.el new file mode 100644 index 0000000..ec489b9 --- /dev/null +++ b/skkdic-ext.el @@ -0,0 +1,374 @@ +;;; skkdic-ext.el --- An extension for skkdic-util to support conjugation + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: skkdic-ext.el,v 0.7 1996/11/12 09:13:25 morioka Exp $ +;; Keywords: input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'skkdic-util) + +(or (fboundp 'orig::skkdic-lookup-key) + (fset 'orig::skkdic-lookup-key + (symbol-function 'skkdic-lookup-key)) + ) + +(defun skkdic-lookup-key (vec len &optional postfix ps) + "Return a list of conversion string for sequence SEQ of length LEN. + +SEQ is a vector of Kana characters to be converted by SKK dictionary. +If LEN is shorter than the length of KEYSEQ, the first LEN keys in SEQ +is concerned. + +Postfixes are concerned only if the optional argument POSTFIX is +non-nil. + +\[skkdic-ext.el]" + (let ((dest (reverse (orig::skkdic-lookup-key vec len nil)))) + (setq vec (subseq (copy-sequence vec) 0 len)) + (let ((ws (cdr (assq ps skkdic-ext-suffix)))) + (mapcar (lambda (word) + (let ((ret (bottom-vector-string-match (aref word 1) vec))) + (if ret + (let* ((lr (length (cdr ret))) + (pre (car ret)) + (lpre (length pre)) + ) + (if (= lpre 0) + (let ((str + (mapconcat (function char-to-string) + (aref word 2) + ""))) + (or (member str dest) + (setq dest (cons str dest)) + ) + ) + (let ((rret (skkdic-lookup-key + pre lpre nil (aref word 0))) + ) + (if rret + (let ((suf + (mapconcat (function char-to-string) + (aref word 2) + ""))) + (mapcar (lambda (r) + (let ((str + (concat + (mapconcat + (function char-to-string) + r + "") + suf))) + (or (member str dest) + (setq dest (cons str dest)) + ))) + rret))) + )))))) + ws)) + dest)) + +(setq skkdic-ext-suffix + '((nil + [nil "。" "。"] + [nil "、" "、"] + [nil "?" "?"] + [nil ":" ":"] + [nil ";" ";"] + [nil "ばあい" "場合"] + [nil "ほうほう" "方法"] + [noun "より" "より"] + [noun "から" "から"] + [noun "へは" "へは"] + [noun "かも" "かも"] + [noun "でも" "でも"] + [noun "では" "では"] + [noun "よ" "よ"] + [noun "は" "は"] + [noun "が" "が"] + [noun "に" "に"] + [noun "を" "を"] + [noun "へ" "へ"] + [noun "の" "の"] + [noun "と" "と"] + [noun "か" "か"] + [noun "も" "も"] + [noun "で" "で"] + [noun "か" "化"] + [noun "か" "か"] + [noun "す" "す"] + [mizen "う" "う"] + [renyou "た" "た"] + [renyou "て" "て"] + [renyou "だ" "だ"] + [v-u1 "る" "る"] + [v-u1 "れ" "れ"] + [v-u1 "よ" "よ"] + [v-k5 "く" "く"] + [v-k5 "け" "け"] + [v-g5 "ぐ" "ぐ"] + [v-g5 "げ" "げ"] + [v-s5 "す" "す"] + [nil "す" "す"] + [nil "する" "する"] + [nil "すれ" "すれ"] + [nil "せよ" "せよ"] + [nil "しろ" "しろ"] + [v-s5 "せ" "せ"] + [v-t5 "つ" "つ"] + [v-t5 "て" "て"] + [v-n5 "ぬ" "ぬ"] + [v-n5 "ね" "ね"] + [v-m5 "む" "む"] + [v-m5 "め" "め"] + [v-b5 "ぶ" "ぶ"] + [v-b5 "べ" "べ"] + [v-r5 "る" "る"] + [v-r5 "れ" "れ"] + [v-w5 "う" "う"] + [v-w5 "え" "え"] + [adj "い" "い"] + [adj "けれ" "けれ"] + [noun "しゃ" "者"] + ) + (noun + [nil "あふぉーだんす" "アフォーダンス"] + [nil "じょうほう" "情報"] + ) + (mizen + [adj "かろ" "かろ"] + [v-k5 "か" "か"] + [v-k5 "こ" "こ"] + [v-g5 "が" "が"] + [v-g5 "ご" "ご"] + [v-s5 "さ" "さ"] + [v-s5 "そ" "そ"] + [nil "せ" "せ"] + [v-t5 "た" "た"] + [v-t5 "と" "と"] + [v-n5 "な" "な"] + [v-n5 "の" "の"] + [v-m5 "ま" "ま"] + [v-m5 "も" "も"] + [v-b5 "ば" "ば"] + [v-b5 "ぼ" "ぼ"] + [v-r5 "ら" "ら"] + [v-r5 "ろ" "ろ"] + [v-w5 "わ" "わ"] + [v-w5 "お" "お"] + ) + (renyou + [adj "かっ" "かっ"] + [adj "く" "く"] + [renyou "まし" "まし"] + [v-5i "い" "い"] + [v-5q "っ" "っ"] + [v-5n "ん" "ん"] + [v-k5 "き" "き"] + [v-k5 "ぎ" "ぎ"] + [v-s5 "し" "し"] + [nil "し" "し"] + [v-t5 "ち" "ち"] + [v-n5 "に" "に"] + [v-m5 "み" "み"] + [v-b5 "び" "び"] + [v-r5 "り" "り"] + ) + (v-5i + [nil "か" "書"] + ) + (v-s5 + [nil "かん" "関"] + ) + (adj + [nil "らし" "らし"] + [nil "な" "な"] + ) + )) + +(defun bottom-vector-string-match (pat seq) + (or (vectorp pat) + (setq pat (string-to-vector pat)) + ) + (if (vectorp seq) + (setq seq (copy-sequence seq)) + (setq seq (string-to-vector seq)) + ) + (let ((lp (length pat)) + (ls (length seq)) + ) + (if (> lp ls) + nil + (catch 'not-matched + (while (> lp 0) + (setq lp (1- lp) + ls (1- ls)) + (or (eq (aref pat lp)(aref seq ls)) + (throw 'not-matched nil) + ) + ) + (cons (subseq seq 0 ls) pat) + )))) + + +(defvar sana-prefix +;;(setq sana-prefix + '((1 (adj + ["く" "く"] + ["し" "し"] + ["き" "き"] + ["い" "い"] + ["さ" "さ"] + ) + ;; (v-k* + ;; ["き" "き"] + ;; ["き" "来"] + ;; ["き" "來"] + ;; ["く" "く"] + ;; ["く" "来"] + ;; ["く" "來"] + ;; ["こ" "こ"] + ;; ["こ" "来"] + ;; ["こ" "來"] + ;; ) + ;; (v-s* + ;; ["し" "し"] + ;; ["せ" "せ"] + ;; ) + ;; (v-z* + ;; ["じ" "じ"] + ;; ["ず" "ず"] + ;; ["ぜ" "ぜ"] + ;; ) + + (+v-nari + ["に" "に"] + ) + (+v-tari + ["と" "と"] + ) + (+v-da + ["で" "で"] + ["に" "に"] + ["な" "な"] + ) + (+v-ya + ["え" "ぇ"] + ["や" "や"] + ) + ) + (2 + (v-k* + ["くる" "くる"] + ["くる" "来る"] + ["くる" "來る"] + ["くれ" "くれ"] + ["くれ" "来れ"] + ["くれ" "來れ"] + ["こよ" "こよ"] + ["こよ" "来よ"] + ["こよ" "來よ"] + ["こい" "こい"] + ["こい" "来い"] + ["こい" "來い"] + ) + (v-s* + ["する" "する"] + ["すれ" "すれ"] + ["され" "され"] + ["せよ" "せよ"] + ) + (v-z* + ["ずる" "ずる"] + ["ずれ" "ずれ"] + ["ぜよ" "ぜよ"] + ) + (+v-nari + ["なら" "なら"] + ["なり" "なり"] + ["なる" "なる"] + ["なれ" "なれ"] + ) + (+v-tari + ["たら" "たら"] + ["たり" "たり"] + ["たる" "たる"] + ["たれ" "たれ"] + ) + (+v-da + ["だろ" "だろ"] + ;;["だっ" "だっ"] + ;;["なら" "なら"] + ) + (+v-ya + ["やろ" "やろ"] + ;;["やっ" "やっ"] + ;;["やら" "やら"] + ) + (+v-desu + ["です" "です"] + ;;["でし" "でし"] + ) + (beki + ["べく" "べく"] + ["べし" "べし"] + ["べき" "べき"] + ) + (renyou + ["いた" "いた"] + ["った" "った"] + ) + ) + (3 (+v-dearu + ;;["であら" "であら"] + ["であり" "であり"] + ["である" "である"] + ;;["であれ" "であれ"] + ) + (+v-desu + ["でしょ" "でしょ"] + ) + ;; (beki + ;; ["べから" "べから"] + ;; ["べかり" "べかり"] + ;; ["べかる" "べかる"] + ;; ["べけれ" "べけれ"] + ;; ) + (renyou + ["ますか" "ますか"] + ) + ) + (4 (+v-desu + ["でしょう" "でしょう"] + )) + (5 (n + ["にかんして" "に関して"] + )))) + + +;;; @ end +;;; + +(provide 'skkdic-ext) + +(run-hooks 'skkdic-ext-load-hook) + +;;; skkdic-ext.el ends here diff --git a/yude-canna.el b/yude-canna.el new file mode 100644 index 0000000..016027d --- /dev/null +++ b/yude-canna.el @@ -0,0 +1,102 @@ +;;; yude-canna.el --- Boiled-Egg like roman to kanaji converter + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: yude-canna.el,v 0.2 1996/11/12 09:18:37 morioka Exp $ +;; Keywords: input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'nabe) +(require 'canna) + + +;;; @ initialize +;;; + +(canna) + + +;;; @ functions +;;; + +(defun canna-rk-no-trans-region (start end) + "Insert alpha-numeric string as it is sent from keyboard." + (interactive "r") + (let ((res)) + (setq res (canna-rk-region start end)) + (delete-region start end) + (if (null canna:*japanese-mode*) + (progn + (setq canna:*exit-japanese-mode* t) )) + (canna:enter-canna-mode) + (canna:display-candidates res) + (canna-kakutei-to-basic-stat) + )) + +(setq nabe-roman-to-kanji-function 'canna-rk-trans-region) +(setq nabe-roman-to-kana-function 'canna-rk-no-trans-region) + + +;;; @ redefine +;;; + +(or (fboundp 'canna:original-quit-canna-mode) + (fset 'canna:original-quit-canna-mode + (symbol-function 'canna:quit-canna-mode)) + ) +(defun canna:quit-canna-mode () + (canna:original-quit-canna-mode) + (if (string= (canna-query-mode) "[半英]") + (progn + (canna-do-function canna-func-base-zenkaku) + (canna-do-function canna-func-base-kana) + (canna-toggle-japanese-mode) + ))) + +(defun canna-kakutei-to-basic-stat () + (let ((res 0) + (kakutei + (mapconcat (function + (lambda (chr) + (if (eq chr ?\ ) + "" + (char-to-string chr) + ) + )) + canna-henkan-string "")) + ) + (while (not canna-empty-info) + (setq res (canna-do-function canna-func-kakutei)) + ) + (setq canna-kakutei-string kakutei) + (canna:display-candidates (length canna-kakutei-string)) + (if (not canna:*japanese-mode*) + (mode-line-canna-mode-update canna:*alpha-mode-string*)) + )) + + +;;; @ end +;;; + +(provide 'yude-canna) + +;;; yude-canna.el ends here diff --git a/yude-egg.el b/yude-egg.el new file mode 100644 index 0000000..25ebd27 --- /dev/null +++ b/yude-egg.el @@ -0,0 +1,70 @@ +;;; yude-egg.el --- Boiled-Egg like roman to kanaji converter + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: yude-egg.el,v 0.5 1996/11/12 09:04:30 morioka Exp $ +;; Keywords: input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'nabe) +(require 'egg) + +(defun yude-egg-its-region (start end) + (interactive "r") + (let ((string (buffer-substring start end)) + egg-mode) + (delete-region start end) + (egg-mode) + (unless (string= string "") + (let ((last-command-char (aref string 0))) + (egg-self-insert-char) + ) + (let ((i 1) + (len (length string)) + ) + (while (< i len) + (let ((last-command-char (aref string i))) + (its-self-insert-char) + ) + (setq i (1+ i)) + ))) + (its-exit-mode) + )) + +(defun yude-egg-translate-region (start end) + (interactive "r") + (save-restriction + (narrow-to-region start end) + (yude-egg-its-region start end) + (egg-convert-region (point-min)(point-max)) + )) + +(setq nabe-roman-to-kanji-function 'yude-egg-translate-region) +(setq nabe-roman-to-kana-function 'yude-egg-its-region) + + +;;; @ end +;;; + +(provide 'yude-egg) + +;;; yude-egg.el ends here diff --git a/yude-kkc.el b/yude-kkc.el new file mode 100644 index 0000000..15ad269 --- /dev/null +++ b/yude-kkc.el @@ -0,0 +1,51 @@ +;;; yude-kkc.el --- Boiled-Egg like roman to kanaji converter + +;; Copyright (C) 1996 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: yude-kkc.el,v 0.5 1996/11/12 09:04:30 morioka Exp $ +;; Keywords: input, Japanese, mule + +;; This file is not part of GNU Emacs. + +;; This program 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. + +;; This program 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. + +;;; Code: + +(require 'nabe) +(require 'roman-to-kana) +(require 'kkc) + +(defun yude-kkc-translate-region (start end) + (let ((e (save-excursion + (save-restriction + (narrow-to-region start end) + (roman-to-kana-translate-region start end) + (point-max) + )))) + (kkc-region start e) + )) + +(setq nabe-roman-to-kanji-function 'yude-kkc-translate-region) +(setq nabe-roman-to-kana-function 'roman-to-kana-translate-region) + + +;;; @ end +;;; + +(provide 'yude-kkc) + +;;; yude-kkc.el ends here -- 1.7.10.4