(japanese-traditionalize-string): Prefer `<-simplified@JP/Jouyou' and
authortomo <tomo>
Wed, 23 Jan 2008 07:01:48 +0000 (07:01 +0000)
committertomo <tomo>
Wed, 23 Jan 2008 07:01:48 +0000 (07:01 +0000)
`<-simplified@JP'.
(japanese-traditionalize-region): Use `char-feature' instead of
`get-char-attribute'.
(japanese-simplify-region): Likewise.

ideo-trans.el

index 85d1888..3385583 100644 (file)
@@ -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 <tomo@kanji.zinbun.kyoto-u.ac.jp>
 ;; Keywords: Ideographs, Character Database, Chaon, CHISE
     (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)))
        (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
        (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