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-Ext-H.txt" load-ids-simplify t)
47 (install-ids-read-file "IDS-UCS-Ext-I.txt" load-ids-simplify t)
49 (install-ids-read-file "IDS-UCS-Compat.txt" load-ids-simplify t)
51 (install-ids-read-file "IDS-UCS-Compat-Supplement.txt" load-ids-simplify t)
55 (install-ids-read-file (format "IDS-CNS-%d.txt" i)
61 (install-ids-read-file (format "IDS-Daikanwa-%02d.txt" i)
65 (install-ids-read-file "IDS-Daikanwa-dx.txt" load-ids-simplify t)
67 (install-ids-read-file "IDS-Daikanwa-ho.txt" load-ids-simplify t)
69 (install-ids-read-file "IDS-CBETA.txt" load-ids-simplify t)
71 (install-ids-read-file "IDS-CDP.txt" load-ids-simplify t)
74 ;; (install-ids-read-file (format "IDS-HZK%02d.txt" i)
75 ;; load-ids-simplify t)
78 (install-ids-read-file "IDS-SW-JIGUGE.txt" load-ids-simplify t)
80 (princ "Generating apparent-structure...")
81 (let* ((terminal-coding-system 'utf-8-mcs-er)
86 "character" chise-system-db-directory)))
88 (expand-file-name "ideographic-products" feature-dir))
91 (when (file-exists-p p-file)
92 (setq old-p-file (make-temp-name p-file))
93 (rename-file p-file old-p-file))
94 (ids-update-index 'in-memory)
98 (unless (equal (setq ret (ideographic-structure-compact v)) v)
99 (princ (format "Compact %04X (%c) : %s -> %s\n"
102 (ideographic-structure-to-ids v)
103 (ideographic-structure-to-ids ret)))
104 (put-char-attribute c 'ideographic-structure ret)
106 (unless (setq a-str (get-char-attribute c 'ideographic-structure@apparent))
107 (when (setq a-str (functional-ideographic-structure-to-apparent-structure v))
108 (put-char-attribute c 'ideographic-structure@apparent
109 (ideographic-structure-compact a-str))))
111 'ideographic-structure)
115 (unless (equal (setq ret (ideographic-structure-compact v)) v)
116 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
119 (ideographic-structure-to-ids v)
120 (ideographic-structure-to-ids ret)))
121 (put-char-attribute c 'ideographic-structure@apparent ret)
124 'ideographic-structure@apparent)
128 (unless (equal (setq ret (ideographic-structure-compact v)) v)
129 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
132 (ideographic-structure-to-ids v)
133 (ideographic-structure-to-ids ret)))
134 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
137 'ideographic-structure@apparent/leftmost)
141 (unless (equal (setq ret (ideographic-structure-compact v)) v)
142 (princ (format "Compact %04X (%c) : [apparent/rightmost] %s -> %s\n"
145 (ideographic-structure-to-ids v)
146 (ideographic-structure-to-ids ret)))
147 (put-char-attribute c 'ideographic-structure@apparent/rightmost ret)
150 'ideographic-structure@apparent/rightmost)
154 (unless (equal (setq ret (ideographic-structure-compact v)) v)
155 (princ (format "Compact %04X (%c) : %s -> %s\n"
158 (ideographic-structure-to-ids v)
159 (ideographic-structure-to-ids ret)))
160 (put-char-attribute c 'ideographic-structure ret)
163 'ideographic-structure)
166 (unless (equal (setq ret (ideographic-structure-compact v)) v)
167 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
170 (ideographic-structure-to-ids v)
171 (ideographic-structure-to-ids ret)))
172 (put-char-attribute c 'ideographic-structure@apparent ret)
175 'ideographic-structure@apparent)
178 (unless (equal (setq ret (ideographic-structure-compact v)) v)
179 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
182 (ideographic-structure-to-ids v)
183 (ideographic-structure-to-ids ret)))
184 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
187 'ideographic-structure@apparent/leftmost)
190 (unless (equal (setq ret (ideographic-structure-compact v)) v)
191 (princ (format "Compact %04X (%c) : [apparent/rightmost] %s -> %s\n"
194 (ideographic-structure-to-ids v)
195 (ideographic-structure-to-ids ret)))
196 (put-char-attribute c 'ideographic-structure@apparent/rightmost ret)
199 'ideographic-structure@apparent/rightmost)
202 (princ "Updating char-feature `ideographic-structure'...")
203 (save-char-attribute-table 'ideographic-structure)
204 (save-char-attribute-table 'ideographic-structure@apparent)
207 (princ "Updating char-feature `ideographic-products'...")
210 (delete-file old-p-file)))
213 ;;; install-ids.el ends hear