From: tomo Date: Tue, 26 Nov 2002 02:58:39 +0000 (+0000) Subject: (ideographic-structure-char=): New function; check `<-radical' X-Git-Tag: ids-0_0-1~184 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7c5dd028679dc42261916abbe9b5ad8e30372b5a;p=chise%2Fids.git (ideographic-structure-char=): New function; check `<-radical' attribute. (ideographic-structure-member-compare-parts): Use `ideographic-structure-char='. --- diff --git a/ids-find.el b/ids-find.el index e68d8a1..871a8ef 100644 --- a/ids-find.el +++ b/ids-find.el @@ -24,13 +24,22 @@ ;;; Code: +(defun ideographic-structure-char= (c1 c2) + (or (eq c1 c2) + (and c1 c2 + (or (eq (char-ucs c1)(char-ucs c2)) + (let ((m1 (car (get-char-attribute c1 '<-radical))) + (m2 (car (get-char-attribute c2 '<-radical)))) + (unless (characterp m1) + (setq m1 (or (find-char m1)))) + (unless (characterp m2) + (setq m2 (find-char m2))) + (when (or m1 m2) + (ideographic-structure-char= m1 m2))))))) + (defun ideographic-structure-member-compare-parts (part s-part) (let (ret) - (cond ((char-ref= part s-part - (lambda (c1 c2) - (or (eq c1 c2) - (and c1 c2 - (eq (char-ucs c1)(char-ucs c2))))))) + (cond ((char-ref= part s-part #'ideographic-structure-char=)) ((listp s-part) (if (setq ret (assq 'ideographic-structure s-part)) (ideographic-structure-member part (cdr ret))))