X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=char-db-dump.el;h=81b6413a0a9969f316d0a41f2a03033826f5b5d9;hb=321faf6fc28841890223cc68bae906300db663a9;hp=8db86dd5779ab24ff607d16dc2d5cb2d0533b271;hpb=bf01d9f90b1dc730f895484f01c03a9c59d281ba;p=chise%2Ftomoyo-tools.git diff --git a/char-db-dump.el b/char-db-dump.el index 8db86dd..81b6413 100644 --- a/char-db-dump.el +++ b/char-db-dump.el @@ -1,9 +1,9 @@ ;;; char-db-dump.el --- Dump utility of char-spec files -;; Copyright (C) 2002,2003 MORIOKA Tomohiko +;; Copyright (C) 2002,2003,2004,2005,2010 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko -;; Keywords: Ideographs, Character Database, UTF-2000, UCS, Unicode +;; Keywords: Ideographs, Character Database, CHISE, UCS, Unicode ;; This file is a part of tomoyo-tools. @@ -108,6 +108,7 @@ (#x3130 #x318F "u03130-Hangul-Compatibility-Jamo.el") (#x3190 #x319F "u03190-Kanbun.el") (#x31A0 #x31BF "u031A0-Bopomofo-Extended.el") + (#x31C0 #x31EF "u031C0-CJK-Strokes.el") (#x31F0 #x31FF "u031F0-Katakana-Phonetic-Extensions.el") (#x3200 #x32FF "u03200-Enclosed-CJK-Letters-and-Months.el") (#x3300 #x33FF "u03300-CJK-Compatibility.el") @@ -138,10 +139,83 @@ ;;;###autoload +(defun char-db-dump-oracle-bones (directory) + (interactive "DDump Oracle-Bones : ") + (let ((coding-system-for-write char-db-file-coding-system) + (code 1) + chr a-chr) + (with-temp-buffer + (insert (format ";; -*- coding: %s -*-\n" + char-db-file-coding-system)) + (while (<= code 8192) + (when (setq chr (decode-char '=zinbun-oracle code 'defined-only)) + (setq a-chr (decode-char '=>zinbun-oracle code 'defined-only)) + (unless (eq a-chr chr) + (insert-char-data a-chr)) + (insert-char-data chr)) + (setq code (1+ code))) + (write-region (point-min)(point-max) + (expand-file-name "Oracle-Bones.el" directory))))) + +;;;###autoload +(defun char-db-dump-shuowen (directory) + (interactive "DDump Shuowen : ") + (let ((coding-system-for-write char-db-file-coding-system) + (code 1) + chr) + (with-temp-buffer + (insert (format ";; -*- coding: %s -*-\n" + char-db-file-coding-system)) + (while (<= code 52101) + (when (setq chr (decode-char '=shuowen-jiguge code 'defined-only)) + (insert-char-data chr)) + (setq code (1+ code))) + (write-region (point-min)(point-max) + (expand-file-name "ShuoWen.el" directory))))) + +;;;###autoload +(defun char-db-dump-ruimoku6 (directory) + (interactive "DDump ruimoku6 : ") + (let ((coding-system-for-write char-db-file-coding-system) + (code #xE000) + chr) + (with-temp-buffer + (insert (format ";; -*- coding: %s -*-\n" + char-db-file-coding-system)) + (while (<= code #xE8FF) + (when (setq chr (decode-char '=ruimoku-v6 code 'defined-only)) + (insert-char-data chr)) + (setq code (1+ code))) + (write-region (point-min)(point-max) + (expand-file-name "ruimoku6.el" directory))))) + +;;;###autoload +(defun char-db-dump-additional-precomposed (directory) + (interactive "DDump additional-precomposed : ") + (let ((coding-system-for-write char-db-file-coding-system)) + (with-temp-buffer + (insert (format ";; -*- coding: %s -*-\n" + char-db-file-coding-system)) + (map-char-attribute + (lambda (char value) + (unless (char-ucs char) + (unless (char-ucs char) + (insert-char-data char))) + nil) + '=decomposition) + (write-region (point-min)(point-max) + (expand-file-name + "additional-precomposed.el" directory))))) + + +;;;###autoload (defun char-db-dump (directory) (interactive "DDirectory to dump : ") (char-db-dump-ideographs directory) - (char-db-dump-non-ideographs directory)) + (char-db-dump-non-ideographs directory) + (char-db-dump-oracle-bones directory) + (char-db-dump-ruimoku6 directory) + (char-db-dump-additional-precomposed directory)) ;;; @ End.