From: tomo Date: Tue, 17 Dec 2002 11:12:06 +0000 (+0000) Subject: (ideographic-structure-member): Add autoload cookie and DOC-string. X-Git-Tag: ids-0_0-1~173 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a470b505b5753f9d1951923b233e31be13a9a467;p=chise%2Fids.git (ideographic-structure-member): Add autoload cookie and DOC-string. (ideographic-structure-repertoire-p): New function. --- diff --git a/ids-find.el b/ids-find.el index 7683d8f..ad9ff9c 100644 --- a/ids-find.el +++ b/ids-find.el @@ -50,7 +50,9 @@ ((setq ret (get-char-attribute s-part 'ideographic-structure)) (ideographic-structure-member part ret))))) +;;;###autoload (defun ideographic-structure-member (part structure) + "Return non-nil if PART is included in STRUCTURE." (or (progn (setq structure (cdr structure)) (ideographic-structure-member-compare-parts part (car structure))) @@ -63,6 +65,32 @@ (ideographic-structure-member-compare-parts part (car structure)))))) + +;;;###autoload +(defun ideographic-structure-repertoire-p (structure parts) + "Return non-nil if STRUCTURE can be constructed by a subset of PARTS." + (and structure + (let (ret s-part) + (catch 'tag + (while (setq structure (cdr structure)) + (setq s-part (car structure)) + (unless (characterp s-part) + (if (setq ret (find-char s-part)) + (setq s-part ret))) + (unless (cond + ((listp s-part) + (if (setq ret (assq 'ideographic-structure s-part)) + (ideographic-structure-repertoire-p + (cdr ret) parts))) + ((member* s-part parts + :test #'ideographic-structure-char=)) + ((setq ret + (get-char-attribute s-part + 'ideographic-structure)) + (ideographic-structure-repertoire-p ret parts))) + (throw 'tag nil))) + t)))) + ;;;###autoload (defun ideographic-structure-search-chars (parts) "Search Ideographs by PARTS."