1 ;;; conv-util.el --- Dump utility of mapping tables
3 ;; Copyright (C) 2004 MORIOKA Tomohiko
5 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
6 ;; Keywords: Ideographs, Character Database, CHISE, UCS, Unicode
8 ;; This file is a part of tomoyo-tools.
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 (require 'ideograph-util)
30 (defun conv-u-convert-char (c &optional v)
31 (setq v (get-char-attribute c '->ucs-unified))
32 (let (ufs ifs ucs guc m ret)
34 (setq m (get-char-attribute c 'morohashi-daikanwa))
35 (setq m (if (eq (nth 1 m) 0)
37 (list (car m)(nth 1 m)))))
38 (setq m (encode-char c '=daikanwa 'defined-only)))
39 (setq ufs (char-attribute-alist c)
42 (setq ifs (intersection
44 (char-attribute-alist vc)
46 (if (setq ucs (encode-char c '=ucs 'defined-only))
48 (remove-char-attribute c '=ucs)
50 (put-char-attribute c '=ucs@unicode ucs)
51 (put-char-attribute c '=ucs@iso ucs))
52 (remove-char-attribute c '->ucs-unified))
53 (setq ucs (char-ucs c)))
54 (setq v (sort (cons c v)
55 (function ideograph-char<)))
56 (setq ret (define-char
57 (cons (cons '->subsumptive v)
59 (put-char-attribute ret '=ucs ucs)
62 (remove-char-attribute vc (car isf)))
63 (when (and (setq m (get-char-attribute vc 'morohashi-daikanwa))
66 (remove-char-attribute vc 'morohashi-daikanwa))
67 (if (eq ucs (get-char-attribute vc '=>ucs))
68 (remove-char-attribute vc '=>ucs)))
77 ;;; conv-util.el ends here