(U+6C17): Add `<-simplified@JP/Jouyou'.
[chise/xemacs-chise.git.1] / lisp / utf-2000 / read-maps.el
index e1926f8..a764315 100644 (file)
@@ -1,6 +1,6 @@
 ;;; read-maps.el --- Read mapping-tables.
 
-;; Copyright (C) 2002,2003 MORIOKA Tomohiko
+;; Copyright (C) 2002,2003,2004 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
 ;; Keywords: mapping table, character, CCS, multiscript, multilingual
                                  (and (not (memq ucs-ccs '(ucs-jis
                                                            =ucs-jis-1990
                                                             =ucs-jis-2000
-                                                            ;; ucs-big5
+                                                           ;; ucs-big5
                                                            )))
                                       (get-char-attribute chr '=>ucs)))
                              ucs)))
                (put-char-attribute chr ucs-ccs ucs)))))
        (forward-line)))))
 
+(defun jp-jouyou-read-file (filename)
+  (interactive "fjp-jouyou file : ")
+  (with-temp-buffer
+    (buffer-disable-undo)
+    (insert-file-contents filename)
+    (goto-char (point-min))
+    (let (char tchars)
+      (while (re-search-forward "^[^\t\n ]+\t\\(.\\)\t*" nil t)
+       (setq char (aref (match-string 1) 0)
+             tchars (buffer-substring (match-end 0)
+                                      (point-at-eol)))
+       (when (> (length tchars) 0)
+         (setq tchars
+               (mapcar (lambda (c)
+                         (aref c 0))
+                       (split-string tchars " ")))
+         (put-char-attribute char
+                             '<-simplified@JP/Jouyou
+                             tchars))
+        ;; (put-char-attribute
+        ;;  char 'script (adjoin
+        ;;                'JP
+        ;;                (adjoin
+        ;;                 'Jouyou
+        ;;                 (adjoin
+        ;;                  'Ideograph
+        ;;                  (get-char-attribute char 'script)))))
+       ))))
 
 (provide 'read-maps)