From: MORIOKA Tomohiko Date: Thu, 3 Sep 2020 12:31:02 +0000 (+0900) Subject: - Don't install Install IDS-HZK{01..12}.txt. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99b71986102cdf54656769eb51b8a87db579c4a1;p=chise%2Fids.git - Don't install Install IDS-HZK{01..12}.txt. - Use `functional-ideographic-structure-to-apparent-structure' to generate `ideographic-structure@apparent' from `ideographic-structure'. --- diff --git a/install-ids.el b/install-ids.el index 1e5d05d..eb02062 100644 --- a/install-ids.el +++ b/install-ids.el @@ -63,18 +63,13 @@ (install-ids-read-file "IDS-CBETA.txt" load-ids-simplify t) (install-ids-read-file "IDS-CDP.txt" load-ids-simplify t) -(let ((i 1)) - (while (<= i 12) - (install-ids-read-file (format "IDS-HZK%02d.txt" i) - load-ids-simplify t) - (setq i (1+ i)))) - -(princ "Updating char-feature `ideographic-structure'...") -(save-char-attribute-table 'ideographic-structure) -(save-char-attribute-table 'ideographic-structure@apparent) -(princ "done.\n") +;; (let ((i 1)) +;; (while (<= i 12) +;; (install-ids-read-file (format "IDS-HZK%02d.txt" i) +;; load-ids-simplify t) +;; (setq i (1+ i)))) -(princ "Updating char-feature `ideographic-products'...") +(princ "Generating apparent-structure...") (let* ((feature-dir (expand-file-name "feature" @@ -82,10 +77,29 @@ "character" chise-system-db-directory))) (p-file (expand-file-name "ideographic-products" feature-dir)) - old-p-file) + old-p-file + a-str) (when (file-exists-p p-file) (setq old-p-file (make-temp-name p-file)) (rename-file p-file old-p-file)) + (ids-update-index 'in-memory) + + (map-char-attribute + (lambda (c v) + (unless (setq a-str (get-char-attribute c 'ideographic-structure@apparent)) + (when (setq a-str (functional-ideographic-structure-to-apparent-structure v)) + (put-char-attribute c 'ideographic-structure@apparent + (ideographic-structure-compact a-str)))) + nil) + 'ideographic-structure) + (princ "done.\n") + + (princ "Updating char-feature `ideographic-structure'...") + (save-char-attribute-table 'ideographic-structure) + (save-char-attribute-table 'ideographic-structure@apparent) + (princ "done.\n") + + (princ "Updating char-feature `ideographic-products'...") (ids-update-index) (when old-p-file (delete-file old-p-file)))