From: Kenichi Handa Date: Fri, 16 Mar 2001 08:18:41 +0000 (+0000) Subject: (quail-japanese-transliteration-rules): New variable. Use it to X-Git-Tag: emacs-pretest-21.0.101~295 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=18a5ee60a78c199a4eb4e6ecc598f5081f738c43;p=emacs.git (quail-japanese-transliteration-rules): New variable. Use it to define these input methods: "japanese", "japanese-hiragana", "japanese-katakana". --- diff --git a/leim/quail/japanese.el b/leim/quail/japanese.el index ef9de406e5e..0b28aa0e7c0 100644 --- a/leim/quail/japanese.el +++ b/leim/quail/japanese.el @@ -130,6 +130,124 @@ (activate-input-method (car pkg)))))) (throw 'quail-tag nil)) +(defvar quail-japanese-transliteration-rules + '(( "a" "あ") ( "i" "い") ( "u" "う") ( "e" "え") ( "o" "お") + ("ka" "か") ("ki" "き") ("ku" "く") ("ke" "け") ("ko" "こ") + ("sa" "さ") ("si" "し") ("su" "す") ("se" "せ") ("so" "そ") + ("ta" "た") ("ti" "ち") ("tu" "つ") ("te" "て") ("to" "と") + ("na" "な") ("ni" "に") ("nu" "ぬ") ("ne" "ね") ("no" "の") + ("ha" "は") ("hi" "ひ") ("hu" "ふ") ("he" "へ") ("ho" "ほ") + ("ma" "ま") ("mi" "み") ("mu" "む") ("me" "め") ("mo" "も") + ("ya" "や") ("yu" "ゆ") ("yo" "よ") + ("ra" "ら") ("ri" "り") ("ru" "る") ("re" "れ") ("ro" "ろ") + ("la" "ら") ("li" "り") ("lu" "る") ("le" "れ") ("lo" "ろ") + ("wa" "わ") ("wi" "ゐ") ("wu" "う") ("we" "ゑ") ("wo" "を") + ("n'" "ん") + ("ga" "が") ("gi" "ぎ") ("gu" "ぐ") ("ge" "げ") ("go" "ご") + ("za" "ざ") ("zi" "じ") ("zu" "ず") ("ze" "ぜ") ("zo" "ぞ") + ("da" "だ") ("di" "ぢ") ("du" "づ") ("de" "で") ("do" "ど") + ("ba" "ば") ("bi" "び") ("bu" "ぶ") ("be" "べ") ("bo" "ぼ") + ("pa" "ぱ") ("pi" "ぴ") ("pu" "ぷ") ("pe" "ぺ") ("po" "ぽ") + + ("kya" ["きゃ"]) ("kyu" ["きゅ"]) ("kye" ["きぇ"]) ("kyo" ["きょ"]) + ("sya" ["しゃ"]) ("syu" ["しゅ"]) ("sye" ["しぇ"]) ("syo" ["しょ"]) + ("sha" ["しゃ"]) ("shu" ["しゅ"]) ("she" ["しぇ"]) ("sho" ["しょ"]) + ("cha" ["ちゃ"]) ("chu" ["ちゅ"]) ("che" ["ちぇ"]) ("cho" ["ちょ"]) + ("tya" ["ちゃ"]) ("tyu" ["ちゅ"]) ("tye" ["ちぇ"]) ("tyo" ["ちょ"]) + ("nya" ["にゃ"]) ("nyu" ["にゅ"]) ("nye" ["にぇ"]) ("nyo" ["にょ"]) + ("hya" ["ひゃ"]) ("hyu" ["ひゅ"]) ("hye" ["ひぇ"]) ("hyo" ["ひょ"]) + ("mya" ["みゃ"]) ("myu" ["みゅ"]) ("mye" ["みぇ"]) ("myo" ["みょ"]) + ("rya" ["りゃ"]) ("ryu" ["りゅ"]) ("rye" ["りぇ"]) ("ryo" ["りょ"]) + ("lya" ["りゃ"]) ("lyu" ["りゅ"]) ("lye" ["りぇ"]) ("lyo" ["りょ"]) + ("gya" ["ぎゃ"]) ("gyu" ["ぎゅ"]) ("gye" ["ぎぇ"]) ("gyo" ["ぎょ"]) + ("zya" ["じゃ"]) ("zyu" ["じゅ"]) ("zye" ["じぇ"]) ("zyo" ["じょ"]) + ("jya" ["じゃ"]) ("jyu" ["じゅ"]) ("jye" ["じぇ"]) ("jyo" ["じょ"]) + ( "ja" ["じゃ"]) ( "ju" ["じゅ"]) ( "je" ["じぇ"]) ( "jo" ["じょ"]) + ("bya" ["びゃ"]) ("byu" ["びゅ"]) ("bye" ["びぇ"]) ("byo" ["びょ"]) + ("pya" ["ぴゃ"]) ("pyu" ["ぴゅ"]) ("pye" ["ぴぇ"]) ("pyo" ["ぴょ"]) + + ("kwa" ["くゎ"]) ("kwi" ["くぃ"]) ("kwe" ["くぇ"]) ("kwo" ["くぉ"]) + ("tsa" ["つぁ"]) ("tsi" ["つぃ"]) ("tse" ["つぇ"]) ("tso" ["つぉ"]) + ( "fa" ["ふぁ"]) ( "fi" ["ふぃ"]) ( "fe" ["ふぇ"]) ( "fo" ["ふぉ"]) + ("gwa" ["ぐゎ"]) ("gwi" ["ぐぃ"]) ("gwe" ["ぐぇ"]) ("gwo" ["ぐぉ"]) + + ("dyi" ["でぃ"]) ("dyu" ["どぅ"]) ("dye" ["でぇ"]) ("dyo" ["どぉ"]) + ("xwi" ["うぃ"]) ("xwe" ["うぇ"]) ("xwo" ["うぉ"]) + + ("shi" "し") ("tyi" ["てぃ"]) ("chi" "ち") ("tsu" "つ") ("ji" "じ") + ("fu" "ふ") + ("ye" ["いぇ"]) + + ("va" ["ヴぁ"]) ("vi" ["ヴぃ"]) ("vu" "ヴ") ("ve" ["ヴぇ"]) ("vo" ["ヴぉ"]) + + ("xa" "ぁ") ("xi" "ぃ") ("xu" "ぅ") ("xe" "ぇ") ("xo" "ぉ") + ("xtu" "っ") ("xya" "ゃ") ("xyu" "ゅ") ("xyo" "ょ") ("xwa" "ゎ") + ("xka" "ヵ") ("xke" "ヶ") + + ("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?" "∞") + + ("\\\\" quail-japanese-self-insert-and-switch-to-alpha) + ("{{" quail-japanese-self-insert-and-switch-to-alpha) + ("}}" quail-japanese-self-insert-and-switch-to-alpha) + + ("qq" quail-japanese-switch-package) + ("qz" quail-japanese-switch-package) + )) + + ;; ローマ字入力及び仮名漢字変換による日本語入力メソッド ;; ;; この入力メソッドでの日本語の入力は二つのステージ「ローマ字仮名変換」 @@ -298,124 +416,8 @@ C-h kkc-help ([return] . quail-no-conversion)) ) -(quail-define-rules - -( "a" "あ") ( "i" "い") ( "u" "う") ( "e" "え") ( "o" "お") -("ka" "か") ("ki" "き") ("ku" "く") ("ke" "け") ("ko" "こ") -("sa" "さ") ("si" "し") ("su" "す") ("se" "せ") ("so" "そ") -("ta" "た") ("ti" "ち") ("tu" "つ") ("te" "て") ("to" "と") -("na" "な") ("ni" "に") ("nu" "ぬ") ("ne" "ね") ("no" "の") -("ha" "は") ("hi" "ひ") ("hu" "ふ") ("he" "へ") ("ho" "ほ") -("ma" "ま") ("mi" "み") ("mu" "む") ("me" "め") ("mo" "も") -("ya" "や") ("yu" "ゆ") ("yo" "よ") -("ra" "ら") ("ri" "り") ("ru" "る") ("re" "れ") ("ro" "ろ") -("la" "ら") ("li" "り") ("lu" "る") ("le" "れ") ("lo" "ろ") -("wa" "わ") ("wi" "ゐ") ("wu" "う") ("we" "ゑ") ("wo" "を") -("n'" "ん") -("ga" "が") ("gi" "ぎ") ("gu" "ぐ") ("ge" "げ") ("go" "ご") -("za" "ざ") ("zi" "じ") ("zu" "ず") ("ze" "ぜ") ("zo" "ぞ") -("da" "だ") ("di" "ぢ") ("du" "づ") ("de" "で") ("do" "ど") -("ba" "ば") ("bi" "び") ("bu" "ぶ") ("be" "べ") ("bo" "ぼ") -("pa" "ぱ") ("pi" "ぴ") ("pu" "ぷ") ("pe" "ぺ") ("po" "ぽ") - -("kya" ["きゃ"]) ("kyu" ["きゅ"]) ("kye" ["きぇ"]) ("kyo" ["きょ"]) -("sya" ["しゃ"]) ("syu" ["しゅ"]) ("sye" ["しぇ"]) ("syo" ["しょ"]) -("sha" ["しゃ"]) ("shu" ["しゅ"]) ("she" ["しぇ"]) ("sho" ["しょ"]) -("cha" ["ちゃ"]) ("chu" ["ちゅ"]) ("che" ["ちぇ"]) ("cho" ["ちょ"]) -("tya" ["ちゃ"]) ("tyu" ["ちゅ"]) ("tye" ["ちぇ"]) ("tyo" ["ちょ"]) -("nya" ["にゃ"]) ("nyu" ["にゅ"]) ("nye" ["にぇ"]) ("nyo" ["にょ"]) -("hya" ["ひゃ"]) ("hyu" ["ひゅ"]) ("hye" ["ひぇ"]) ("hyo" ["ひょ"]) -("mya" ["みゃ"]) ("myu" ["みゅ"]) ("mye" ["みぇ"]) ("myo" ["みょ"]) -("rya" ["りゃ"]) ("ryu" ["りゅ"]) ("rye" ["りぇ"]) ("ryo" ["りょ"]) -("lya" ["りゃ"]) ("lyu" ["りゅ"]) ("lye" ["りぇ"]) ("lyo" ["りょ"]) -("gya" ["ぎゃ"]) ("gyu" ["ぎゅ"]) ("gye" ["ぎぇ"]) ("gyo" ["ぎょ"]) -("zya" ["じゃ"]) ("zyu" ["じゅ"]) ("zye" ["じぇ"]) ("zyo" ["じょ"]) -("jya" ["じゃ"]) ("jyu" ["じゅ"]) ("jye" ["じぇ"]) ("jyo" ["じょ"]) -( "ja" ["じゃ"]) ( "ju" ["じゅ"]) ( "je" ["じぇ"]) ( "jo" ["じょ"]) -("bya" ["びゃ"]) ("byu" ["びゅ"]) ("bye" ["びぇ"]) ("byo" ["びょ"]) -("pya" ["ぴゃ"]) ("pyu" ["ぴゅ"]) ("pye" ["ぴぇ"]) ("pyo" ["ぴょ"]) - -("kwa" ["くゎ"]) ("kwi" ["くぃ"]) ("kwe" ["くぇ"]) ("kwo" ["くぉ"]) -("tsa" ["つぁ"]) ("tsi" ["つぃ"]) ("tse" ["つぇ"]) ("tso" ["つぉ"]) -( "fa" ["ふぁ"]) ( "fi" ["ふぃ"]) ( "fe" ["ふぇ"]) ( "fo" ["ふぉ"]) -("gwa" ["ぐゎ"]) ("gwi" ["ぐぃ"]) ("gwe" ["ぐぇ"]) ("gwo" ["ぐぉ"]) - -("dyi" ["でぃ"]) ("dyu" ["どぅ"]) ("dye" ["でぇ"]) ("dyo" ["どぉ"]) -("xwi" ["うぃ"]) ("xwe" ["うぇ"]) ("xwo" ["うぉ"]) - -("shi" "し") ("tyi" ["てぃ"]) ("chi" "ち") ("tsu" "つ") ("ji" "じ") -("fu" "ふ") -("ye" ["いぇ"]) - -("va" ["ヴぁ"]) ("vi" ["ヴぃ"]) ("vu" "ヴ") ("ve" ["ヴぇ"]) ("vo" ["ヴぉ"]) - -("xa" "ぁ") ("xi" "ぃ") ("xu" "ぅ") ("xe" "ぇ") ("xo" "ぉ") -("xtu" "っ") ("xya" "ゃ") ("xyu" "ゅ") ("xyo" "ょ") ("xwa" "ゎ") -("xka" "ヵ") ("xke" "ヶ") - -("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?" "∞") - -("\\\\" quail-japanese-self-insert-and-switch-to-alpha) -("{{" quail-japanese-self-insert-and-switch-to-alpha) -("}}" quail-japanese-self-insert-and-switch-to-alpha) - -("qq" quail-japanese-switch-package) -("qz" quail-japanese-switch-package) - -) +(dolist (elt quail-japanese-transliteration-rules) + (quail-defrule (car elt) (nth 1 elt))) (quail-define-package "japanese-ascii" "Japanese" "Aa" @@ -520,6 +522,12 @@ qq: toggle between this input method and the input method `japanese-ascii'. nil t t nil nil nil nil nil 'quail-japanese-katakana-update-translation) -;; Use the same map as that of `japanese'. -(setcar (cdr (cdr quail-current-package)) - (nth 2 (assoc "japanese" quail-package-alist))) +(dolist (elt quail-japanese-transliteration-rules) + (quail-defrule (car elt) + (let ((trans (nth 1 elt))) + (cond((stringp trans) + (japanese-katakana trans)) + ((vectorp trans) + (vector (japanese-katakana (aref trans 0)))) + (t trans))))) +