(HZK01-C949): Complete and compact IDS.
[chise/ids.git] / ids-find.el
index 2af3021..edcac5e 100644 (file)
@@ -1,9 +1,9 @@
 ;;; ids-find.el --- search utility based on Ideographic-structures
 
-;; Copyright (C) 2002 MORIOKA Tomohiko
+;; Copyright (C) 2002,2003 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
-;; Keywords: Kanji, Ideographs, search, IDS
+;; Keywords: Kanji, Ideographs, search, IDS, CHISE, UCS, Unicode
 
 ;; This file is a part of Tomoyo-Tools.
 
                 (m2 (char-ucs c2)))
             (or (and m1 m2
                      (eq m1 m2))
+                (some (lambda (b2)
+                        (unless (characterp b2)
+                          (setq b2 (find-char b2)))
+                        (and b2
+                             (ideographic-structure-char= c1 b2)))
+                      (get-char-attribute
+                       c2 '<-ideographic-component-forms))
                 (progn
                   (setq m1 (car (get-char-attribute c1 '<-radical))
                         m2 (car (get-char-attribute c2 '<-radical)))
                   (unless (characterp m1)
-                    (setq m1 (or (find-char m1))))
+                    (setq m1 (find-char m1)))
                   (unless (characterp m2)
                     (setq m2 (find-char m2)))
                   (when (or m1 m2)
       (map-char-attribute
        (lambda (c v)
         (when (ideographic-structure-repertoire-p v components)
-          (insert
-           (ids-find-format-line c v)
-            ;; (format "%c\t%s\t%s\n"
-            ;;         c
-            ;;         (or
-            ;;          (when (setq ucs (char-ucs c))
-            ;;            (or
-            ;;             (when (setq jis
-            ;;                         (encode-char
-            ;;                          (decode-char
-            ;;                           'ucs-jis (char-ucs c))
-            ;;                          'japanese-jisx0208-1990))
-            ;;               (format "J0-%04X" jis))))
-            ;;          "")
-            ;;         (or (ideographic-structure-to-ids v)
-            ;;             v))
-           )))
+          (insert (ids-find-format-line c v))))
        'ideographic-structure))
     (goto-char (point-min)))
   (view-buffer ids-find-result-buffer))