X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=ids-util.el;h=b1b96f11a9fc60a544131e053c58a2b6c6c848b4;hb=ce961d1b0b188ae67cb894a251b9791b379e2546;hp=7d1c740502c1950e34535b93331c2764fd5fa352;hpb=561c7fa2f38d4366663cd97478eab7d2c9a631f0;p=chise%2Fids.git diff --git a/ids-util.el b/ids-util.el index 7d1c740..b1b96f1 100644 --- a/ids-util.el +++ b/ids-util.el @@ -1,6 +1,6 @@ ;;; ids-util.el --- Utilities about ideographic-structure -*- coding: utf-8 -*- -;; Copyright (C) 2001,2002,2003 MORIOKA Tomohiko +;; Copyright (C) 2001,2002,2003,2004 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: ideographic-structure, CHISE, IDS, IDC, UCS, database @@ -27,6 +27,30 @@ ;;; Code: ;;;###autoload +(defun ideographic-structure-convert-to-domain (structure domain) + (let (dest cell ret) + (while structure + (setq cell (car structure)) + (setq dest + (cons + (cond ((characterp cell) + (char-representative-of-domain cell domain)) + ((and (consp cell) + (symbolp (car cell))) + cell) + ((setq ret (find-char cell)) + (char-representative-of-domain cell domain)) + ((setq ret (assq 'ideographic-structure cell)) + (put-alist 'ideographic-structure + (ideographic-structure-convert-to-domain + (cdr ret) domain) + (copy-alist cell))) + (t cell)) + dest)) + (setq structure (cdr structure))) + (nreverse dest))) + +;;;###autoload (defun ideographic-structure-convert-to-ucs (structure) (let (dest cell ucs ret) (while structure