From: tomo Date: Thu, 28 Apr 2005 09:12:04 +0000 (+0000) Subject: New file. X-Git-Tag: chise-core-0_22~47 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cd74c8c0441741a6acb58b48e7cfffe54ef1e29;p=chise%2Fids.git New file. --- diff --git a/www/www-ids-find.el b/www/www-ids-find.el new file mode 100644 index 0000000..f197a25 --- /dev/null +++ b/www/www-ids-find.el @@ -0,0 +1,88 @@ +(require 'ids-find) + +(defun decode-url-string (string &optional coding-system) + (if (> (length string) 0) + (let ((i 0) + dest) + (while (string-match "%\\([0-9A-F][0-9A-F]\\)" string i) + (setq dest (concat dest + (substring string i (match-beginning 0)) + (char-to-string + (int-char + (string-to-int (match-string 1 string) 16)))) + i (match-end 0))) + (decode-coding-string + (concat dest (substring string i)) + coding-system)))) + +(let ((components (car command-line-args-left)) + is) + (setq command-line-args-left (cdr command-line-args-left)) + (cond + ((stringp components) + (if (string-match "^components=" components) + (setq components (substring components (match-end 0)))) + (setq components + (if (> (length components) 0) + (decode-url-string components 'utf-8-jp-er) + nil)) + ) + (t + (setq components nil) + )) + (princ "Content-Type: text/html; charset=\"UTF-8\" + + + + +CHISE IDS Find + + + + +

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

+

+

+") + (princ (encode-coding-string "部品文字列" 'utf-8-jp-er)) + (princ " (length components) 0) + (princ (encode-coding-string components 'utf-8-er))) + (princ "\"> + +
+ +") + (when components + ;; (map-char-attribute + ;; (lambda (c v) + ;; (when (every (lambda (p) + ;; (ideographic-structure-member p v)) + ;; components) + ;; (princ (encode-coding-string + ;; (ids-find-format-line c v) + ;; 'utf-8-jp-er)) + ;; (princ "
\n") + ;; ) + ;; nil) + ;; '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) + (princ (encode-coding-string (ids-find-format-line c is) + 'utf-8-jp-er)) + (princ "
\n") + )) + ) + (princ " + + +"))