Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-68
[bpt/emacs.git] / lisp / international / ja-dic-utl.el
index 6afeceb..23874db 100644 (file)
@@ -1,7 +1,8 @@
 ;;; ja-dic-utl.el --- utilities for handling Japanese dictionary (SKK-JISYO.L)
 
-;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
+;; Copyright (C) 1995, 2000
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: mule, multilingual, Japanese
 
@@ -19,8 +20,8 @@
 
 ;; 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.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -88,7 +89,9 @@
       (setq heads (cdr heads)))
     l))
 
-(defconst skkdic-jisx0208-hiragana-block (nth 1 (split-char ?\e$B$"\e(B)))
+(defconst skkdic-jisx0208-hiragana-block
+  (cons (decode-char 'japanese-jisx0208 #x2421)
+       (decode-char 'japanese-jisx0208 #x247E)))
 
 (defun skkdic-lookup-key (seq len &optional postfix prefer-noun)
   "Return a list of conversion string for sequence SEQ of length LEN.
@@ -128,14 +131,17 @@ LEIM is available from the same ftp directory as Emacs."))
     ;;   else VEC[N] is 128.
     (while (< i len)
       (let ((ch (aref seq i))
-           elts)
-       (if (= ch ?\e$B!<\e(B)
-           (aset vec i 0)
-         (setq elts (split-char ch))
-         (if (and (eq (car elts) 'japanese-jisx0208)
-                  (= (nth 1 elts) skkdic-jisx0208-hiragana-block))
-             (aset vec i (- (nth 2 elts) 32))
-           (aset vec i 128))))
+           code)
+       (cond ((= ch ?\e$B!<\e(B)
+              (aset vec i 0))
+             ((and (>= ch (car skkdic-jisx0208-hiragana-block))
+                   (<= ch (cdr skkdic-jisx0208-hiragana-block)))
+              (setq code (encode-char ch 'japanese-jisx0208))
+              (if code
+                  (aset vec i (- (logand code #xFF) 32))
+                (aset vec i 128)))
+             (t
+              (aset vec i 128))))
       (setq i (1+ i)))
 
     ;; Search OKURI-NASI entries.
@@ -217,4 +223,5 @@ LEIM is available from the same ftp directory as Emacs."))
 ;; coding: iso-2022-7bit
 ;; End:
 
+;;; arch-tag: df2218fa-469c-40f6-bace-7f89a053f9c0
 ;;; ja-dic-utl.el ends here