aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Choi2001-05-23 16:54:04 +0000
committerAndrew Choi2001-05-23 16:54:04 +0000
commita4c4011b95d01ae4e9e9aa60e537234ceaccf61e (patch)
tree1ae0e0bb6fe76cb71824b1d1de4bb4c855d6cb95
parentf1f65349f47be2982fc2dfb3847c730e520703f6 (diff)
downloademacs-a4c4011b95d01ae4e9e9aa60e537234ceaccf61e.tar.gz
emacs-a4c4011b95d01ae4e9e9aa60e537234ceaccf61e.zip
2001-05-24 Andrew Choi <akochoi@i-cable.com>
* international/titdic-cnv.el (quail-cxterm-package-ext-info): delete entries for chinese-ctlau and chinese-ctlaub. (quail-misc-package-ext-info): add entries for chinese-ctlau and chinese-ctlaub. (ctlau-converter): New function. (ctlau-gb-converter): New function. (ctlau-b5-converter): New function.
-rw-r--r--lisp/international/titdic-cnv.el146
1 files changed, 142 insertions, 4 deletions
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 004dc7b8b83..f1dd762405e 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -102,10 +102,6 @@ For expample:
102For double-width GB2312 characters correponding to ASCII, use the 102For double-width GB2312 characters correponding to ASCII, use the
103input method `chinese-qj'.") 103input method `chinese-qj'.")
104 104
105 ("chinese-ctlau" "$AAuTA(B")
106
107 ("chinese-ctlaub" "$(0N,Gn(B")
108
109 ("chinese-ecdict" "$(05CKH(B" 105 ("chinese-ecdict" "$(05CKH(B"
110"In this input method, you enter a Chinese (Big5) charactere or word 106"In this input method, you enter a Chinese (Big5) charactere or word
111by typing the corresponding English word. For example, if you type 107by typing the corresponding English word. For example, if you type
@@ -669,6 +665,68 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"."
669;; You should have received a copy of the GNU General Public License along with 665;; You should have received a copy of the GNU General Public License along with
670;; CCE; see the file COPYING. If not, write to the Free Software Foundation, 666;; CCE; see the file COPYING. If not, write to the Free Software Foundation,
671;; 675 Mass Ave, Cambridge, MA 02139, USA.") 667;; 675 Mass Ave, Cambridge, MA 02139, USA.")
668
669 ("chinese-b5-quick" "$(0X|(BB"
670 "cangjie-table.b5" big5 "quick-b5.el"
671 quick-b5-converter
672 "\
673;; # Copyright 2001 Christian Wittern <wittern@iis.sinica.edu.tw>
674;; #
675;; # Permission to copy and distribute both modified and
676;; # unmodified versions is granted without royalty provided
677;; # this notice is preserved.")
678
679 ("chinese-ctlau" "$AAuTA(B"
680 "CTLau.html" cn-gb-2312 "CTLau.el"
681 ctlau-gb-converter
682 "\
683;; \"CTLau.html\" is available at:
684;;
685;; http://umunhum.stanford.edu/~lee/chicomp/CTLau.html
686;;
687;; It contains the following copyright notice:
688;;
689;; # Copyright (C) 1988-2001 Fung Fung Lee (lee@umunhum.stanford.edu)
690;; #
691;; # This program is free software; you can redistribute it and/or
692;; # modify it under the terms of the GNU General Public License
693;; # as published by the Free Software Foundation; either version 2
694;; # of the License, or any later version.
695;; #
696;; # This program is distributed in the hope that it will be useful,
697;; # but WITHOUT ANY WARRANTY; without even the implied warranty of
698;; # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
699;; # GNU General Public License for more details.
700;; #
701;; # You should have received a copy of the GNU General Public License
702;; # along with this program; if not, write to the Free Software Foundation,
703;; # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")
704
705 ("chinese-ctlaub" "$(0N,Gn(B"
706 "CTLau-b5.html" big5 "CTLauB.el"
707 ctlau-b5-converter
708 "\
709;; \"CTLau-b5.html\" is available at:
710;;
711;; http://umunhum.stanford.edu/~lee/chicomp/CTLau-b5.html
712;;
713;; It contains the following copyright notice:
714;;
715;; # Copyright (C) 1988-2001 Fung Fung Lee (lee@umunhum.stanford.edu)
716;; #
717;; # This program is free software; you can redistribute it and/or
718;; # modify it under the terms of the GNU General Public License
719;; # as published by the Free Software Foundation; either version 2
720;; # of the License, or any later version.
721;; #
722;; # This program is distributed in the hope that it will be useful,
723;; # but WITHOUT ANY WARRANTY; without even the implied warranty of
724;; # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
725;; # GNU General Public License for more details.
726;; #
727;; # You should have received a copy of the GNU General Public License
728;; # along with this program; if not, write to the Free Software Foundation,
729;; # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")
672 )) 730 ))
673 731
674;; Generate a code of a Quail package in the current buffer from Tsang 732;; Generate a code of a Quail package in the current buffer from Tsang
@@ -963,6 +1021,86 @@ To input symbols and punctuations, type `/' followed by one of `a' to
963 (insert (format "(%S %S)\n" (car elt) (cdr elt)))) 1021 (insert (format "(%S %S)\n" (car elt) (cdr elt))))
964 (insert ")\n"))) 1022 (insert ")\n")))
965 1023
1024;; Generate the code for a Quail package in the current buffer from a
1025;; CTLau or CTLau-b5 dictionary in the buffer DICBUF. The input
1026;; method name of the Quail package is NAME, and the title string is
1027;; TITLE. DESCRIPTION is the string shown by describe-input-method.
1028
1029(defun ctlau-converter (dicbuf name title description)
1030 (goto-char (point-max))
1031 (insert (format "%S\n" description))
1032 (insert " '((\"\C-?\" . quail-delete-last-char)
1033 (\".\" . quail-next-translation)
1034 (\">\" . quail-next-translation)
1035 (\",\" . quail-prev-translation)
1036 (\"<\" . quail-prev-translation))
1037 nil nil nil nil)\n\n")
1038 (insert "(quail-define-rules\n")
1039 (let (dicbuf-start dicbuf-end key-start key (pos (point)))
1040 ;; Find the dictionary, which starts below a horizontal rule and
1041 ;; ends at the second to last line in the HTML file.
1042 (save-excursion
1043 (set-buffer dicbuf)
1044 (goto-char (point-min))
1045 (search-forward "#\n#<hr>\n")
1046 (setq dicbuf-start (point))
1047 (goto-char (point-max))
1048 (forward-line -1)
1049 (setq dicbuf-end (point)))
1050 (insert-buffer-substring dicbuf dicbuf-start dicbuf-end)
1051 ;; CTLau-b5.html contains characters (0xa1 0xbc) which show up as
1052 ;; hollow boxes when the original characters in CTLau.html from
1053 ;; which the file is converted have no Big5 equivalent. Go
1054 ;; through and delete them.
1055 (goto-char pos)
1056 (while (search-forward "$(0!{(B" nil t)
1057 (delete-char -1))
1058 ;; Uppercase keys in dictionary need to be downcased. Backslashes
1059 ;; at the beginning of keys need to be turned into double
1060 ;; backslashes.
1061 (goto-char pos)
1062 (while (not (eobp))
1063 (insert "(\"")
1064 (if (char-equal (following-char) ?\\)
1065 (insert "\\"))
1066 (setq key-start (point))
1067 (skip-chars-forward "\\\\A-Z")
1068 (downcase-region key-start (point))
1069 (insert "\" \"")
1070 (delete-char 1)
1071 (end-of-line)
1072 (insert "\")")
1073 (forward-line 1)))
1074 (insert ")\n"))
1075
1076(defun ctlau-gb-converter (dicbuf name title)
1077 (ctlau-converter dicbuf name title
1078"$A::WVJdHk!KAuN}OiJ=TARt!K(B
1079
1080 $AAuN}OiJ=TASoW"Rt7=08(B
1081 Sidney Lau's Cantonese transcription scheme as described in his book
1082 \"Elementary Cantonese\", The Government Printer, Hong Kong, 1972.
1083 This file was prepared by Fung Fung Lee ($A@n7c7e(B).
1084 Originally converted from CTCPS3.tit
1085 Last modified: June 2, 1993.
1086
1087 Some infrequent GB characters are accessed by typing \, followed by
1088 the Cantonese romanization of the respective radical ($A2?JW(B)."))
1089
1090(defun ctlau-b5-converter (dicbuf name title)
1091 (ctlau-converter dicbuf name title
1092"$(0KH)tTT&,!(N,Tg>A*#Gn5x!((B
1093
1094 $(0N,Tg>A*#GnM$0D5x'J7{(B
1095 Sidney Lau's Cantonese transcription scheme as described in his book
1096 \"Elementary Cantonese\", The Government Printer, Hong Kong, 1972.
1097 This file was prepared by Fung Fung Lee ($(0,XFS76(B).
1098 Originally converted from CTCPS3.tit
1099 Last modified: June 2, 1993.
1100
1101 Some infrequent characters are accessed by typing \, followed by
1102 the Cantonese romanization of the respective radical ($(0?f5}(B)."))
1103
966(defun miscdic-convert (filename &optional dirname) 1104(defun miscdic-convert (filename &optional dirname)
967 "Convert a dictionary file FILENAME into a Quail package. 1105 "Convert a dictionary file FILENAME into a Quail package.
968Optional argument DIRNAME if specified is the directory name under which 1106Optional argument DIRNAME if specified is the directory name under which