From 981d9c8184ae14bdc29a7c2e098bccd77a557a58 Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 25 Mar 2003 10:36:33 +0000 Subject: [PATCH] New file. --- ideo-trans.el | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ideo-trans.el 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 -- 1.7.10.4