+(defun char-daikanwa (char &optional radical checked depth)
+ (unless radical
+ (setq radical ideographic-radical))
+ (if (or (null radical)
+ (eq (or (get-char-attribute char 'ideographic-radical)
+ (char-daikanwa-radical char radical t))
+ radical))
+ (let ((ret (or (encode-char char '=daikanwa@rev2 'defined-only)
+ ;; (encode-char char '=daikanwa 'defined-only)
+ (get-char-attribute char 'morohashi-daikanwa))))
+ (unless ret
+ (cond
+ ((setq ret (encode-char char '=daikanwa/+p 'defined-only))
+ (setq ret (list ret 1)))
+ ((setq ret (encode-char char '=daikanwa/+2p 'defined-only))
+ (setq ret (list ret 2)))
+ ((setq ret (encode-char char '=daikanwa/ho 'defined-only))
+ (setq ret (list 'ho ret)))))
+ (or (if ret
+ (if depth
+ (if (integerp ret)
+ (list ret depth)
+ (append ret (list depth)))
+ ret))
+ (and (setq ret (get-char-attribute char '=>daikanwa))
+ (if (numberp ret)
+ (list ret -10)
+ (append ret '(-10))))
+ (unless (memq char checked)
+ (unless depth
+ (setq depth 0))
+ (catch 'tag
+ (let ((rest
+ (append
+ (get-char-attribute char '->subsumptive)
+ (get-char-attribute char '->denotational)
+ (get-char-attribute char '->denotational@component)
+ ))
+ (i 0)
+ sc lnum)
+ (setq checked (cons char checked))
+ (while rest
+ (setq sc (car rest))
+ (if (setq ret (char-daikanwa sc radical checked
+ (1- depth)))
+ (throw 'tag ret))
+ (setq checked (cons sc checked)
+ rest (cdr rest)
+ i (1+ i)))
+ (setq rest (get-char-attribute char '->identical))
+ (while rest
+ (setq sc (car rest))
+ (when (setq ret (char-daikanwa sc radical checked depth))
+ (throw 'tag
+ (if (numberp ret)
+ (list ret 0)
+ (append ret (list i)))))
+ (setq checked (cons sc checked)
+ rest (cdr rest)))
+ (setq rest
+ (append
+ (get-char-attribute char '<-subsumptive)
+ (get-char-attribute char '<-denotational)
+ (get-char-attribute char '<-denotational@component)
+ ))
+ (while rest
+ (setq sc (car rest))
+ (when (setq ret (char-daikanwa sc radical checked depth))
+ (throw 'tag
+ (if (numberp ret)
+ (list ret 0 i)
+ (if (>= (setq lnum (car (last ret))) 0)
+ (append ret (list i))
+ (nconc (butlast ret)
+ (list 0 (- lnum) i))))))
+ (setq checked (cons sc checked)
+ rest (cdr rest))))))))))
+
+(defun char-ideographic-strokes-diff (char &optional radical)
+ (if (or (get-char-attribute char '<-subsumptive)
+ (get-char-attribute char '<-denotational))
+ (let (s ds)
+ (when (and (setq s (char-ideographic-strokes char radical))
+ (setq ds (char-daikanwa-strokes char radical)))
+ (abs (- s ds))))
+ 0))