1 ;;; install-ids.el --- installer of IDS files.
5 (setq load-ids-simplify nil)
7 (defun install-ids-read-file (file simplify soft)
11 (ids-read-file file simplify soft)
15 ;; (mount-char-attribute-table 'ideographic-products)
16 ;; (map-char-attribute
18 ;; (remove-char-attribute c 'ideographic-products)
20 ;; 'ideographic-products)
23 (install-ids-read-file "IDS-JIS-X0208-1990.txt" load-ids-simplify t)
25 (install-ids-read-file "IDS-UCS-Basic.txt" load-ids-simplify t)
27 (install-ids-read-file "IDS-UCS-Ext-A.txt" load-ids-simplify t)
31 (install-ids-read-file (format "IDS-UCS-Ext-B-%d.txt" i)
35 (install-ids-read-file "IDS-UCS-Ext-C.txt" load-ids-simplify t)
37 (install-ids-read-file "IDS-UCS-Ext-D.txt" load-ids-simplify t)
39 (install-ids-read-file "IDS-UCS-Ext-E.txt" load-ids-simplify t)
41 (install-ids-read-file "IDS-UCS-Ext-F.txt" load-ids-simplify t)
43 (install-ids-read-file "IDS-UCS-Ext-G.txt" load-ids-simplify t)
45 (install-ids-read-file "IDS-UCS-Compat.txt" load-ids-simplify t)
47 (install-ids-read-file "IDS-UCS-Compat-Supplement.txt" load-ids-simplify t)
51 (install-ids-read-file (format "IDS-CNS-%d.txt" i)
57 (install-ids-read-file (format "IDS-Daikanwa-%02d.txt" i)
61 (install-ids-read-file "IDS-Daikanwa-dx.txt" load-ids-simplify t)
63 (install-ids-read-file "IDS-Daikanwa-ho.txt" load-ids-simplify t)
65 (install-ids-read-file "IDS-CBETA.txt" load-ids-simplify t)
67 (install-ids-read-file "IDS-CDP.txt" load-ids-simplify t)
70 ;; (install-ids-read-file (format "IDS-HZK%02d.txt" i)
71 ;; load-ids-simplify t)
74 (install-ids-read-file "IDS-SW-JIGUGE.txt" load-ids-simplify t)
76 (princ "Generating apparent-structure...")
77 (let* ((terminal-coding-system 'utf-8-mcs-er)
82 "character" chise-system-db-directory)))
84 (expand-file-name "ideographic-products" feature-dir))
87 (when (file-exists-p p-file)
88 (setq old-p-file (make-temp-name p-file))
89 (rename-file p-file old-p-file))
90 (ids-update-index 'in-memory)
94 (unless (equal (setq ret (ideographic-structure-compact v)) v)
95 (princ (format "Compact %04X (%c) : %s -> %s\n"
98 (ideographic-structure-to-ids v)
99 (ideographic-structure-to-ids ret)))
100 (put-char-attribute c 'ideographic-structure ret)
102 (unless (setq a-str (get-char-attribute c 'ideographic-structure@apparent))
103 (when (setq a-str (functional-ideographic-structure-to-apparent-structure v))
104 (put-char-attribute c 'ideographic-structure@apparent
105 (ideographic-structure-compact a-str))))
107 'ideographic-structure)
111 (unless (equal (setq ret (ideographic-structure-compact v)) v)
112 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
115 (ideographic-structure-to-ids v)
116 (ideographic-structure-to-ids ret)))
117 (put-char-attribute c 'ideographic-structure@apparent ret)
120 'ideographic-structure@apparent)
124 (unless (equal (setq ret (ideographic-structure-compact v)) v)
125 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
128 (ideographic-structure-to-ids v)
129 (ideographic-structure-to-ids ret)))
130 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
133 'ideographic-structure@apparent/leftmost)
137 (unless (equal (setq ret (ideographic-structure-compact v)) v)
138 (princ (format "Compact %04X (%c) : %s -> %s\n"
141 (ideographic-structure-to-ids v)
142 (ideographic-structure-to-ids ret)))
143 (put-char-attribute c 'ideographic-structure ret)
146 'ideographic-structure)
149 (unless (equal (setq ret (ideographic-structure-compact v)) v)
150 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
153 (ideographic-structure-to-ids v)
154 (ideographic-structure-to-ids ret)))
155 (put-char-attribute c 'ideographic-structure@apparent ret)
158 'ideographic-structure@apparent)
161 (unless (equal (setq ret (ideographic-structure-compact v)) v)
162 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
165 (ideographic-structure-to-ids v)
166 (ideographic-structure-to-ids ret)))
167 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
170 'ideographic-structure@apparent/leftmost)
173 (princ "Updating char-feature `ideographic-structure'...")
174 (save-char-attribute-table 'ideographic-structure)
175 (save-char-attribute-table 'ideographic-structure@apparent)
178 (princ "Updating char-feature `ideographic-products'...")
181 (delete-file old-p-file)))
184 ;;; install-ids.el ends hear