X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=www%2Fwww-ids-find.el;h=84c6e9e2bf36ea8b12a76512da05eeae92354389;hb=cc352b35fcb514f38923e67f2b5d8a551f7a264c;hp=cf47c73398122da1062365b4474be29467f2c902;hpb=ab20a93f6ab7459242fbdaea82fba2d4107e977a;p=chise%2Fids.git diff --git a/www/www-ids-find.el b/www/www-ids-find.el index cf47c73..84c6e9e 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -15,6 +15,16 @@ (concat dest (substring string i)) coding-system)))) +(defconst www-ids-find-version "0.22.3") + +(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-tang-chars-file-name "~tomo/projects/chise/ids/www/tang-chars.udd") @@ -81,7 +91,13 @@ ) (t (insert "") (insert str) (insert "") @@ -94,13 +110,18 @@ (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)" + ucs))) (princ " ") (when is (princ @@ -134,6 +155,54 @@ (princ (encode-coding-string "⇒[唐代拓本]" 'utf-8-jp-er))) (princ "
\n"))) +(defun www-ids-insert-chars-including-components (components + &optional ignored-chars) + (let ((products (copy-list (ideographic-products-find components))) + is as bs) + (dolist (c (cond + ((> (length products) 10000) + products) + ((> (length products) 4096) + (sort products + (lambda (a b) + (< (char-int a)(char-int b)))) + ) + ((> (length products) 512) + (sort products + (lambda (a b) + (if (setq as (char-total-strokes a)) + (if (setq bs (char-total-strokes b)) + (if (= as bs) + (< (char-int a)(char-int b)) + (< as bs)) + t) + (< (char-int a)(char-int b))))) + ) + (t + (sort 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 (char-feature c 'ideographic-structure)) + (princ "
  • ") + (www-ids-find-format-line c is) + (princ "\n") + ) + )) + ignored-chars) + (defun www-batch-ids-find () (let ((components (car command-line-args-left)) (coded-charset-entity-reference-alist @@ -155,7 +224,7 @@ '(=jis-x0208@1983 "J83-" 4 X) '(=daikanwa "M-" 5 d) coded-charset-entity-reference-alist)) - is) + ) (setq command-line-args-left (cdr command-line-args-left)) (cond ((stringp components) @@ -169,7 +238,7 @@ (t (setq components nil) )) - (princ "Content-Type: text/html; charset=\"UTF-8\" + (princ "Content-Type: text/html; charset=UTF-8 @@ -182,7 +251,20 @@

    ") (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 " +

    +Copyright (C) 2005 MORIOKA Tomohiko +


    ") @@ -197,6 +279,16 @@
    ") + (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 ;; (map-char-attribute @@ -215,13 +307,16 @@ (www-ids-find-format-line (aref components 0) (char-feature (aref components 0) 'ideographic-structure))) - (dolist (c (ideographic-products-find components)) - (setq is (char-feature c 'ideographic-structure)) - ;; to avoid problems caused by wrong indexes - (when (every (lambda (c) - (ideographic-structure-member c is)) - components) - (www-ids-find-format-line c is))) + ;; (dolist (c (ideographic-products-find components)) + ;; (setq is (char-feature c 'ideographic-structure)) + ;; ;; to avoid problems caused by wrong indexes + ;; (when (every (lambda (c) + ;; (ideographic-structure-member c is)) + ;; components) + ;; (www-ids-find-format-line c is))) + (princ "\n") ) (t (princ (encode-coding-string "
    @@ -229,6 +324,39 @@ 指定した部品を全て含む漢字の一覧を表示します。

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

    +\[Links\] +

    + + +" + 'utf-8-jp-er)) + )) (princ "
    ") (princ