(update-ideograph-radical-table): Support `->denotational'.
authortomo <tomo>
Thu, 5 Feb 2004 12:08:33 +0000 (12:08 +0000)
committertomo <tomo>
Thu, 5 Feb 2004 12:08:33 +0000 (12:08 +0000)
(char-daikanwa): If a character has a mother character, return (NUM 0)
instead of NUM.

lisp/utf-2000/ideograph-util.el

index 800bb05..cc2a6f1 100644 (file)
 (defun update-ideograph-radical-table ()
   (interactive)
   (let (ret radical script)
-    (dolist (domain char-db-feature-domains)
+    (dolist (feature
+            (cons 'ideographic-radical
+                  (mapcar
+                   (lambda (domain)
+                     (intern (format "%s@%s" 'ideographic-radical domain)))
+                   char-db-feature-domains)))
       (map-char-attribute
-       (lambda (char radical)
-        (when (and radical
-                   (or (null (setq script (get-char-attribute char 'script)))
-                       (memq 'Ideograph script)))
-          (unless (memq char
-                        (setq ret
-                              (aref ideograph-radical-chars-vector radical)))
-            (char-ideographic-strokes char)
-            (aset ideograph-radical-chars-vector radical
-                  (cons char ret))))
+       (lambda (chr radical)
+        (dolist (char (cons chr
+                            (get-char-attribute chr '->denotational)))
+          (when (and radical
+                     (or (null (setq script
+                                     (get-char-attribute char 'script)))
+                         (memq 'Ideograph script)))
+            (unless (memq char
+                          (setq ret
+                                (aref ideograph-radical-chars-vector
+                                      radical)))
+              (char-ideographic-strokes char)
+              (aset ideograph-radical-chars-vector radical
+                    (cons char ret)))))
         nil)
-       (intern (format "%s@%s" 'ideographic-radical domain))))
-    (map-char-attribute
-     (lambda (char radical)
-       (when (and radical
-                 (or (null (setq script (get-char-attribute char 'script)))
-                     (memq 'Ideograph script)))
-        (unless (memq char
-                      (setq ret
-                            (aref ideograph-radical-chars-vector radical)))
-          (char-ideographic-strokes char)
-          (aset ideograph-radical-chars-vector radical
-                (cons char ret))))
-       nil)
-     'ideographic-radical)
+       feature))
     (map-char-attribute
      (lambda (char data)
        (dolist (cell data)
 (defun char-daikanwa (char)
   (or (encode-char char 'ideograph-daikanwa 'defined-only)
       (encode-char char '=daikanwa-rev2 'defined-only)
-      (get-char-attribute char '=>daikanwa)
+      (let ((ret (char-feature char '=>daikanwa)))
+       (and ret
+            (if (or (get-char-attribute char '<-unified)
+                    (get-char-attribute char '<-denotational))
+                (list ret 0)
+              ret)))
       (get-char-attribute char 'morohashi-daikanwa)))
 
 ;;;###autoload