X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=www%2Fwww-ids-find.el;h=c6af0a8090fc3842a1367896f87ad81a0c809ee7;hb=f5c81e4555968b87c7784198762f2d6efd5457d5;hp=436454cb4f72626abfca6743728a72a0d14fb599;hpb=3479b75d6dd6fcadf7297a521a63fd770ae2a86c;p=chise%2Fids.git diff --git a/www/www-ids-find.el b/www/www-ids-find.el index 436454c..c6af0a8 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -1,4 +1,550 @@ (require 'ids-find) +(require 'cwiki-common) + +(defun www-format-encode-string (string &optional without-tags as-body) + (with-temp-buffer + (insert string) + (let (plane code subcode start end char variants ret rret) + (when as-body + (goto-char (point-min)) + (while (search-forward "&" nil t) + (replace-match "&" nil t))) + (goto-char (point-min)) + (while (search-forward "<" nil t) + (replace-match "<" nil t)) + (goto-char (point-min)) + (while (search-forward ">" nil t) + (replace-match ">" nil t)) + (if without-tags + (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er) + (let ((coded-charset-entity-reference-alist + est-coded-charset-entity-reference-alist)) + (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?CB\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"CB%05d\"" + code + chise-wiki-legacy-bitmap-glyphs-url + (/ code 1000) code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?J\\(78\\|83\\|90\\|97\\|SP\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (match-string 2) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"J%s-%04X\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane + (- (lsh code -8) 32) + (- (logand code 255) 32) + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?J0-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"J0-%04X\"" + code + chise-wiki-legacy-bitmap-glyphs-url + (- (lsh code -8) 32) + (- (logand code 255) 32) + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-\\(JA\\|JB\\|JC\\|JD\\|FT\\|IA\\|IB\\|HG\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (match-string 2) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"HD-%s-%04X\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane + (- (lsh code -8) 32) + (- (logand code 255) 32) + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-\\(IP\\|JT\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (match-string 2) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"HD-%s-%04X\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-KS-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"HD-KS%06d\"" + code + chise-wiki-legacy-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-TK-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"HD-KS%06d\"" + code + chise-wiki-legacy-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&G\\([01]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (string-to-int (match-string 1)) + code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"GB%d-%04X\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane + (- (lsh code -8) 32) + (- (logand code 255) 32) + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(R-\\)?C\\([1-7]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"CNS%d-%04X\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(R-\\)?JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"JC3-%04X\"" + code chise-wiki-bitmap-glyph-image-url code) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\)?ZOB-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"ZOB-%04d\"" + code + chise-wiki-legacy-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A2-\\|g2-\\|R-\\)?DJT-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"DJT-%05d\"" + code + chise-wiki-daijiten-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&SW-JIGUGE\\([45]?\\)-\\([0-9]+\\);" nil t) + (setq subcode (match-string 1) + code (string-to-int (match-string 2))) + (setq plane + (if (string= subcode "") + "5" + subcode)) + (replace-match + (format "\"SW-JIGUGE%s-%05d\"" + plane code + chise-wiki-legacy-bitmap-glyphs-url + plane code) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&HNG\\([0-9]+\\)-\\([0-9][0-9][0-9][0-9]\\)\\([0-9]\\);" nil t) + (setq plane (match-string 1) + code (string-to-int (match-string 2)) + subcode (string-to-int (match-string 3))) + (setq subcode + (if (eq subcode 0) + "" + (char-to-string (decode-char 'ascii (+ 96 subcode))))) + (replace-match + (format + "\"HNG%s-%04d%s\"" + plane code subcode + chise-wiki-hng-bitmap-glyphs-url + plane code subcode + ) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(R-\\)?CHISE-HDIC-TSJ\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (setq char (decode-char '===chise-hdic-tsj code)) + (when (setq ret (get-char-attribute char '=hdic-tsj-glyph-id)) + (replace-match + (format + "\"HDIC-TSJ-%s\"" + ret ret) + t 'literal))) + + (goto-char (point-min)) + (while (re-search-forward "&\\(R-\\)?CHISE-HDIC-SYP\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (setq char (decode-char '===chise-hdic-syp code)) + (when (setq ret (get-char-attribute char '=hdic-syp-entry-id)) + (replace-match + (format + "\"HDIC-SYP-%s\"" + ret ret) + t 'literal))) + + (goto-char (point-min)) + (while (re-search-forward "&\\(R-\\)?CHISE-HDIC-KTB\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (setq char (decode-char '===chise-hdic-ktb code)) + (when (setq ret (get-char-attribute char '=hdic-ktb-entry-id)) + (replace-match + (format + "\"HDIC-KTB-%s\"" + ret ret) + t 'literal))) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?AJ1-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"AJ1-%05d\"" + code + chise-wiki-legacy-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|o-\\|G-\\|g2-\\|R-\\)?MJ\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"MJ%06d\"" + code + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?IU[+-]\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"u%04x\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?KU[+-]\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"u%04x-k\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&A-\\(comp\\|cgn\\)U[+-]\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"u%04x\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(A-\\|g2-\\)?U-i\\([0-9]+\\)\\+\\([0-9A-F]+\\);" + nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"u%04x-itaiji-%03d\"" + code + plane + chise-wiki-glyphwiki-glyph-image-url + code + plane + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&A-IWDSU\\+\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 1) 16)) + (replace-match + (format "\"A-IWDSU+%04x\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(A-\\)?CDP-i\\([0-9]+\\)-\\([0-9A-F]+\\);" + nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"cdp-%04x-itaiji-%03d\"" + code + plane + chise-wiki-glyphwiki-glyph-image-url + code + plane + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(A-\\)?CDP-v\\([0-9]+\\)-\\([0-9A-F]+\\);" + nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"cdp-%04x-var-%03d\"" + code + plane + chise-wiki-glyphwiki-glyph-image-url + code + plane + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(A-\\|G-\\|g2-\\|R-\\)?M-\\([0-9]+\\);" + nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"dkw-%05d\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(g2-\\)?U-v\\([0-9]+\\)\\+\\([0-9A-F]+\\);" nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"u%04x-var-%03d\"" + code + plane + chise-wiki-glyphwiki-glyph-image-url + code + plane + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|G-\\|R-\\|g2-\\)?GT-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"GT-%05d\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|G-\\|g2-\\)?GT-K\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"GT-K%05d\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&B-\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 1) 16)) + (replace-match + (format "\"B-%04X\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(A-\\|G-\\|g2-\\|R-\\)?CDP-\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"CDP-%04X\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward + "&\\(I-\\)?HZK\\(0[1-9]\\|1[0-2]\\)-\\([0-9A-F]+\\);" nil t) + (setq plane (match-string 2) + code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"HZK%s-%04X\"" + plane + code + chise-wiki-glyph-cgi-url + plane + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?RUI6-\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"RUI6-%04X\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&hanaJU\\+\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 1) 16)) + (replace-match + (format "\"hanaJU+%04X\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 3) 16)) + (replace-match + (format "\"UU+%04X\"" + code + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&MCS-\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 1) 16)) + (setq start (match-beginning 0) + end (match-end 0)) + (setq char (decode-char 'system-char-id code)) + (cond + ((and (setq variants + (or (www-get-feature-value char '->subsumptive) + (www-get-feature-value char '->denotational))) + (progn + (if (characterp variants) + (setq variants (list variants))) + (while (and variants + (setq ret (www-format-encode-string + (char-to-string (car variants)))) + (string-match "&MCS-\\([0-9A-F]+\\);" ret)) + (setq variants (cdr variants))) + ret)) + (unless (string-match "&MCS-\\([0-9A-F]+\\);" ret) + (goto-char start) + (delete-region start end) + (insert ret)) + ) + ((setq ret (or (www-get-feature-value char 'ideographic-combination) + (www-get-feature-value char 'ideographic-structure))) + (setq ret + (mapconcat + (lambda (ch) + (if (listp ch) + (if (characterp (setq rret (find-char ch))) + (setq ch rret))) + (if (characterp ch) + (www-format-encode-string + (char-to-string ch) without-tags) + (www-format-encode-string + (format "%S" ch) without-tags))) + ret "")) + (when ret + (goto-char start) + (delete-region start end) + (insert ret)) + ))) + )) + ;; (goto-char (point-min)) + ;; (while (search-forward ">-" nil t) + ;; (replace-match "&GT-" t 'literal)) + (buffer-string)))) + +(setq www-format-char-img-style "vertical-align:middle;") (defun decode-url-string (string &optional coding-system) (if (> (length string) 0) @@ -15,114 +561,106 @@ (concat dest (substring string i)) coding-system)))) +(defconst www-ids-find-version "0.100.1") + +(defvar www-ids-find-ideographic-products-file-name + (expand-file-name "ideographic-products" + (expand-file-name + "feature" + (expand-file-name + "character" + chise-system-db-directory)))) + +(defvar www-ids-find-char-viewer-url + "/est/view/character/") + +(defvar www-ids-find-chise-link-map-url-prefix + "http://fonts.jp/chise_linkmap/map.cgi?code=") + (defvar www-ids-find-tang-chars-file-name "~tomo/projects/chise/ids/www/tang-chars.udd") -(defun www-ids-find-format-line (c is) - (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) - plane code ucs) +(defun www-ids-find-format-char (c &optional code-desc) + (let* ((ucs (encode-char c '=ucs))) (princ - (with-temp-buffer - (cond - ((string-match "&CB\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert "\"CB%05d\"\n" - code (/ code 1000) code)) - (insert (format "CB%05d" code)) - ) - ((string-match "&JC3-\\([0-9A-F]+\\);" str) - (setq code (string-to-int (match-string 1 str) 16)) - (insert "\"JC3-%04X\"\n" - code code)) - (insert (format "JC3-%04X" code)) - ) - ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str) - (setq plane (match-string 1 str) - code (string-to-int (match-string 2 str) 16)) - (insert "\"J%s-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (insert (format "J%s-%04X" plane code)) - ) - ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert "\"G%d-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (insert (format "G%d-%04X" plane code)) - ) - ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert "\"C%d-%04X\"\n" - plane code plane code)) - (insert (format "C%d-%04X" plane code)) - ) - ((string-match "&ZOB-\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert "\"ZOB-%04d\"\n" - code code)) - (insert (format "ZOB-%04d" code)) - ) - (t - (insert "") - (insert str) - (insert "") - )) - (goto-char (point-min)) - (while (search-forward "&" nil t) - (replace-match "&" t 'literal)) - (buffer-string) - )) + (format "%s" + www-ids-find-char-viewer-url + (www-uri-encode-object c) + (if ucs + (format "\"u%04x\"%s" + ucs + chise-wiki-glyphwiki-glyph-image-url + ucs + (if code-desc + (encode-coding-string (format " (%c)" c) 'utf-8-mcs-er) + "")) + (www-format-encode-string (char-to-string c))))) + )) + +(defun www-ids-find-format-ids (ids &optional code-desc) + (let (len i ucs ret) + (setq i 0 + len (length ids)) + (while (< i len) + (www-ids-find-format-char (aref ids i)) + (setq i (1+ i))) + (when code-desc + (princ + (format " (%s)" + (mapconcat + (lambda (c) + (setq ucs (or (char-ucs c) + (encode-char c '=>ucs@iso) + (encode-char c '=>ucs@unicode) + (encode-char c '=>ucs@iwds-1) + (encode-char c '=>ucs@iwds-1/normalized) + (encode-char c '=>ucs@component) + (encode-char c '=>ucs@cognate))) + (cond (ucs + (encode-coding-string + (char-to-string (decode-char '=ucs ucs)) + 'utf-8-mcs-er) + ) + (t + (setq ret (encode-coding-string + (char-to-string c) 'utf-8-mcs-er)) + (if (eq (aref ret 0) ?&) + (concat "&" (substring ret 1))) + ))) + ids "")))))) + +(defun www-ids-find-format-line (c is) + (let (ucs ids) + (princ "") + (www-ids-find-format-char c 'code-desc) + (princ "") (princ (or (if (setq ucs (or (char-ucs c) (encode-char c 'ucs))) - (format " %s" - ucs - (cond ((<= ucs #xFFFF) - (format "U+%04X" ucs)) - ((<= ucs #x10FFFF) - (format "U-%08X" ucs)))) + (format + " %s" + ucs + (cond ((<= ucs #xFFFF) + (format "U+%04X" ucs)) + ((<= ucs #x10FFFF) + (format "U-%08X" ucs)))) " "))) + (when ucs + (princ + (format " (link map)" + www-ids-find-chise-link-map-url-prefix ucs))) (princ " ") + ;; (www-ids-find-format-ideographic-structure is 'code-desc) (when is - (princ - (with-temp-buffer - (insert - (encode-coding-string - (ideographic-structure-to-ids is) - 'utf-8-jp-er)) - (goto-char (point-min)) - (while (re-search-forward "&CB\\([0-9]+\\);" nil t) - (setq code (string-to-int (match-string 1))) - (replace-match - (format "\"CB%05d\"" - code (/ code 1000) code) - t 'literal)) - (buffer-string)))) + (setq ids (ideographic-structure-to-ids is)) + ;; (setq i 0 + ;; len (length ids)) + (princ "") + (www-ids-find-format-ids ids 'code-desc) + ;; (while (< i len) + ;; (www-ids-find-format-char (aref ids i)) + ;; (setq i (1+ i))) + (princ "")) (when (and ucs (with-current-buffer (find-file-noselect @@ -140,21 +678,114 @@ (princ (encode-coding-string "⇒[唐代拓本]" 'utf-8-jp-er))) (princ "
\n"))) -(defun www-ids-insert-chars-including-components (components) - (let (is) - (dolist (c (ideographic-products-find components)) - (setq is (char-feature c 'ideographic-structure)) - ;; to avoid problems caused by wrong indexes - (when (every (lambda (cc) - (ideographic-structure-member cc is)) - components) +(defun www-ids-insert-chars-including-components* (components + &optional ignored-chars products) + (unless products + (setq products (ideograph-find-products components ignored-chars))) + (let (is as bs len) + (setq len (length products)) + (princ "\n") + ) + ignored-chars) + +(defun www-ids-insert-chars-including-components (components + &optional ignored-chars) + (let ((products (ideograph-find-products components ignored-chars)) + is as bs len ignore-children) + (setq len (length products)) + (when (>= len 1024) + (setq ignore-children t) + (princ + (encode-coding-string + "

結果が多すぎるため、再帰的検索を省略しました。

" + 'utf-8-jp-er))) + (if (>= len 2048) + (dolist (c products) + (www-ids-find-format-char c)) + (setq ignored-chars + (nreverse + (www-ids-insert-chars-including-components* components ignored-chars products))) + (dolist (c ignored-chars) + (dolist (vc (char-component-variants c)) + (unless (memq vc ignored-chars) + (when (setq is (get-char-attribute vc 'ideographic-structure)) + (princ "
  • ") + (www-ids-find-format-line vc is) + (setq ignored-chars + (www-ids-insert-chars-including-components* + (char-to-string vc) + (cons vc ignored-chars))))))) + (setq products (ideograph-find-products-with-variants components ignored-chars)) + (setq len (length products)) + (when (>= len 512) + (setq ignore-children t) + (princ + (encode-coding-string + "

    結果が多すぎるため、関連字の再帰的検索を省略しました。

    " + 'utf-8-jp-er))) + (if (>= len 1024) + (dolist (c products) + (www-ids-find-format-char c)) + (dolist (c (sort (copy-tree products) + (lambda (a b) + (if (setq as (char-total-strokes a)) + (if (setq bs (char-total-strokes b)) + (if (= as bs) + (ideograph-char< a b) + (< as bs)) + t) + (ideograph-char< a b))))) + (unless (memq c ignored-chars) + (setq is (get-char-attribute c 'ideographic-structure)) + (princ "
  • ") + (www-ids-find-format-line c is) + (unless ignore-children + (setq ignored-chars + (www-ids-insert-chars-including-components* + (char-to-string c) + (cons c ignored-chars)))) + )) + )) + ) + ignored-chars) (defun www-batch-ids-find () (let ((components (car command-line-args-left)) @@ -185,7 +816,7 @@ (setq components (substring components (match-end 0)))) (setq components (if (> (length components) 0) - (decode-url-string components 'utf-8-jp-er) + (decode-url-string components 'utf-8-er) nil)) ) (t @@ -197,30 +828,82 @@ \"http://www.w3.org/TR/html4/loose.dtd\"> + CHISE IDS Find + + -

    ") +
    +

    ") (princ (encode-coding-string "CHISE IDS 漢字検索" 'utf-8-jp-er)) - (princ "

    -

    -

    + (princ "

    ") + (princ " +

    Version ") + (princ www-ids-find-version) + (princ (format-time-string + " (Last-modified: %Y-%m-%d %H:%M:%S)

    " + (nth 5 + (file-attributes + www-ids-find-ideographic-products-file-name)))) + (princ " + +
    +

    +

    +
    + + ") (princ (encode-coding-string "部品文字列" 'utf-8-jp-er)) - (princ " +
    + (length components) 0) - (princ (encode-coding-string components 'utf-8-jp-er))) + (princ (encode-coding-string components 'utf-8-er))) (princ "\"> - +
    +
    ") + (unless (file-newer-than-file-p + www-ids-find-ideographic-products-file-name + (locate-file (car command-line-args) exec-path)) + (princ (encode-coding-string "
    +

    +現在、システムの更新作業中です。しばらくお待ちください。 +


    +" 'utf-8-jp-er)) + ;; (setq components nil) + ) (cond (components + (princ "
    +") ;; (map-char-attribute ;; (lambda (c v) ;; (when (every (lambda (p) @@ -244,25 +927,73 @@ ;; (ideographic-structure-member c is)) ;; components) ;; (www-ids-find-format-line c is))) - (princ "\n") + (princ "
    \n") ) (t - (princ (encode-coding-string "
    + (princ (encode-coding-string "
    +

    指定した部品を全て含む漢字の一覧を表示します。 +

    -CHISE で用いられる実態参照形式(例:&M-00256;)で部品を指定する事もできます。" 'utf-8-jp-er)) +CHISE で用いられる実態参照形式(例:&M-00256;)で部品を指定する事もできます。 +

    +
    +" 'utf-8-jp-er)) + (princ (encode-coding-string " +

    +\[Links\] +

    + + + +

    +
    +" + 'utf-8-jp-er)) + )) - (princ "
    ") + (princ "
    +
    +") + (princ "
    +Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2015, 2016, 2017, 2020, 2021, 2022, 2023 MORIOKA Tomohiko
    ") (princ (format - "Powered by XEmacs CHISE %s." - xemacs-chise-version)) + "
    Powered by XEmacs CHISE %s.
    " + (encode-coding-string xemacs-chise-version 'utf-8-jp-er))) (princ " +
    ")))