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-Compat.txt" load-ids-simplify t)
49 (install-ids-read-file "IDS-UCS-Compat-Supplement.txt" load-ids-simplify t)
53 (install-ids-read-file (format "IDS-CNS-%d.txt" i)
59 (install-ids-read-file (format "IDS-Daikanwa-%02d.txt" i)
63 (install-ids-read-file "IDS-Daikanwa-dx.txt" load-ids-simplify t)
65 (install-ids-read-file "IDS-Daikanwa-ho.txt" load-ids-simplify t)
67 (install-ids-read-file "IDS-CBETA.txt" load-ids-simplify t)
69 (install-ids-read-file "IDS-CDP.txt" load-ids-simplify t)
72 ;; (install-ids-read-file (format "IDS-HZK%02d.txt" i)
73 ;; load-ids-simplify t)
76 (install-ids-read-file "IDS-SW-JIGUGE.txt" load-ids-simplify t)
78 (princ "Generating apparent-structure...")
79 (let* ((terminal-coding-system 'utf-8-mcs-er)
84 "character" chise-system-db-directory)))
86 (expand-file-name "ideographic-products" feature-dir))
89 (when (file-exists-p p-file)
90 (setq old-p-file (make-temp-name p-file))
91 (rename-file p-file old-p-file))
92 (ids-update-index 'in-memory)
96 (unless (equal (setq ret (ideographic-structure-compact v)) v)
97 (princ (format "Compact %04X (%c) : %s -> %s\n"
100 (ideographic-structure-to-ids v)
101 (ideographic-structure-to-ids ret)))
102 (put-char-attribute c 'ideographic-structure ret)
104 (unless (setq a-str (get-char-attribute c 'ideographic-structure@apparent))
105 (when (setq a-str (functional-ideographic-structure-to-apparent-structure v))
106 (put-char-attribute c 'ideographic-structure@apparent
107 (ideographic-structure-compact a-str))))
109 'ideographic-structure)
113 (unless (equal (setq ret (ideographic-structure-compact v)) v)
114 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
117 (ideographic-structure-to-ids v)
118 (ideographic-structure-to-ids ret)))
119 (put-char-attribute c 'ideographic-structure@apparent ret)
122 'ideographic-structure@apparent)
126 (unless (equal (setq ret (ideographic-structure-compact v)) v)
127 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
130 (ideographic-structure-to-ids v)
131 (ideographic-structure-to-ids ret)))
132 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
135 'ideographic-structure@apparent/leftmost)
139 (unless (equal (setq ret (ideographic-structure-compact v)) v)
140 (princ (format "Compact %04X (%c) : [apparent/rightmost] %s -> %s\n"
143 (ideographic-structure-to-ids v)
144 (ideographic-structure-to-ids ret)))
145 (put-char-attribute c 'ideographic-structure@apparent/rightmost ret)
148 'ideographic-structure@apparent/rightmost)
152 (unless (equal (setq ret (ideographic-structure-compact v)) v)
153 (princ (format "Compact %04X (%c) : %s -> %s\n"
156 (ideographic-structure-to-ids v)
157 (ideographic-structure-to-ids ret)))
158 (put-char-attribute c 'ideographic-structure ret)
161 'ideographic-structure)
164 (unless (equal (setq ret (ideographic-structure-compact v)) v)
165 (princ (format "Compact %04X (%c) : [apparent] %s -> %s\n"
168 (ideographic-structure-to-ids v)
169 (ideographic-structure-to-ids ret)))
170 (put-char-attribute c 'ideographic-structure@apparent ret)
173 'ideographic-structure@apparent)
176 (unless (equal (setq ret (ideographic-structure-compact v)) v)
177 (princ (format "Compact %04X (%c) : [apparent/leftmost] %s -> %s\n"
180 (ideographic-structure-to-ids v)
181 (ideographic-structure-to-ids ret)))
182 (put-char-attribute c 'ideographic-structure@apparent/leftmost ret)
185 'ideographic-structure@apparent/leftmost)
188 (unless (equal (setq ret (ideographic-structure-compact v)) v)
189 (princ (format "Compact %04X (%c) : [apparent/rightmost] %s -> %s\n"
192 (ideographic-structure-to-ids v)
193 (ideographic-structure-to-ids ret)))
194 (put-char-attribute c 'ideographic-structure@apparent/rightmost ret)
197 'ideographic-structure@apparent/rightmost)
200 (princ "Updating char-feature `ideographic-structure'...")
201 (save-char-attribute-table 'ideographic-structure)
202 (save-char-attribute-table 'ideographic-structure@apparent)
205 (princ "Updating char-feature `ideographic-products'...")
208 (delete-file old-p-file)))
211 ;;; install-ids.el ends hear