From c3a2a31fb081a55e4e927967fdefb35af0bc30e8 Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 23 Jan 2008 07:01:48 +0000 Subject: [PATCH] (japanese-traditionalize-string): Prefer `<-simplified@JP/Jouyou' and `<-simplified@JP'. (japanese-traditionalize-region): Use `char-feature' instead of `get-char-attribute'. (japanese-simplify-region): Likewise. --- ideo-trans.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ideo-trans.el b/ideo-trans.el index 85d1888..3385583 100644 --- a/ideo-trans.el +++ b/ideo-trans.el @@ -1,6 +1,6 @@ ;;; ideo-trans.el --- Translation utility for Ideographic Strings -;; Copyright (C) 2003,2004,2005 MORIOKA Tomohiko +;; Copyright (C) 2003,2004,2005,2008 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: Ideographs, Character Database, Chaon, CHISE @@ -192,7 +192,9 @@ (mapconcat (lambda (chr) (char-to-string - (cond ((setq ret (char-feature chr '<-simplified)) + (cond ((setq ret (or (char-feature ret '<-simplified@JP/Jouyou) + (char-feature ret '<-simplified@JP) + (char-feature chr '<-simplified))) (if (cdr ret) (ideo-trans-select-char ret (format "%c => " chr)) (car ret))) @@ -231,12 +233,12 @@ (while (and (skip-chars-forward "\x00-\xFF") (not (eobp))) (setq chr (char-after)) - (if (setq ret (or (get-char-attribute chr '<-simplified@JP/Jouyou) - (get-char-attribute chr '<-simplified@jp-jouyou) - (get-char-attribute chr '<-simplified@JP) - (get-char-attribute chr '<-simplified@jp) - (get-char-attribute chr '<-jp-simplified) - (get-char-attribute chr '<-simplified))) + (if (setq ret (or (char-feature chr '<-simplified@JP/Jouyou) + (char-feature chr '<-simplified@jp-jouyou) + (char-feature chr '<-simplified@JP) + (char-feature chr '<-simplified@jp) + (char-feature chr '<-jp-simplified) + (char-feature chr '<-simplified))) (progn (if (cdr ret) (progn @@ -259,12 +261,12 @@ (while (and (skip-chars-forward "\x00-\xFF") (not (eobp))) (setq chr (char-after)) - (if (setq ret (or (get-char-attribute chr '->simplified@JP/Jouyou) - (get-char-attribute chr '->simplified@jp-jouyou) - (get-char-attribute chr '->simplified@JP) - (get-char-attribute chr '->simplified@jp) - (get-char-attribute chr '->jp-simplified) - (get-char-attribute chr '->simplified))) + (if (setq ret (or (char-feature chr '->simplified@JP/Jouyou) + (char-feature chr '->simplified@jp-jouyou) + (char-feature chr '->simplified@JP) + (char-feature chr '->simplified@jp) + (char-feature chr '->jp-simplified) + (char-feature chr '->simplified))) (progn (if (cdr ret) (progn -- 1.7.10.4