From: tomo Date: Tue, 25 Mar 2003 10:36:33 +0000 (+0000) Subject: New file. X-Git-Tag: chise-base-0_23~55 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=981d9c8184ae14bdc29a7c2e098bccd77a557a58;p=chise%2Ftomoyo-tools.git New file. --- diff --git a/ideo-trans.el b/ideo-trans.el new file mode 100644 index 0000000..156cadc --- /dev/null +++ b/ideo-trans.el @@ -0,0 +1,50 @@ +;;; ideo-trans.el --- Translation utility for Ideographic Strings + +;; Copyright (C) 2003 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Keywords: Ideographs, Character Database, Chaon, CHISE + +;; This file is a part of tomoyo-tools. + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +;;;###autoload +(defun ideo-trans-simplify-chinese-string (string) + "Simplify Chinese traditional characters in STRING." + (let (uchr ret) + (mapconcat + (lambda (chr) + (setq uchr + (if (setq ret (or (char-ucs chr) + (get-char-attribute chr '=>ucs@gb))) + (decode-char '=ucs ret) + chr)) + (char-to-string + (if (setq ret (encode-char uchr 'chinese-gb12345)) + (decode-char 'chinese-gb2312 ret) + chr))) + string ""))) + + +;;; @ End. +;;; + +(provide 'ideo-trans) + +;;; ideo-trans.el ends here