From 3029a82da308526f462cd56f87e6774e02615254 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Tue, 15 Mar 2022 22:08:51 +0900 Subject: [PATCH] (est-eval-value-as-object): Accept `=title' as the same as `=name'. (est-eval-value-as-sources): New function. (est-eval-apply-value): - Use `est-eval-value-as-sources' instead of `est-eval-value-as-domain-list' for format `space-separated-domain-list'. - Support new format `space-separated-source-list'. --- est-eval.el | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 1 deletion(-) diff --git a/est-eval.el b/est-eval.el index ef1914f..10ff991 100644 --- a/est-eval.el +++ b/est-eval.el @@ -374,6 +374,7 @@ genre-o 'object-representative-feature)) 'name)) (www-get-feature-value value '=name) + (www-get-feature-value value '=title) (est-eval-value-default value)) )) ))) @@ -721,6 +722,108 @@ value))) (est-eval-value-default value))) +(defun est-eval-value-as-sources (value) + (if (listp value) + (let (unit-str + source item source-objs source0 start end num + source-cobj title) + (list* 'res-list + '(:separator " ") + (mapcar + (lambda (unit) + (setq unit-str + (if (symbolp unit) + (symbol-name unit) + (format "%s" unit))) + (if (string-match "=" unit-str) + (setq source (intern + (substring unit-str 0 (match-beginning 0))) + item (car (read-from-string + (substring unit-str (match-end 0))))) + (setq source unit + item nil)) + (cond + ((and (setq source-cobj (concord-decode-object + '=chise-bib-id source 'bibliography)) + (setq title (concord-object-get source-cobj '=title))) + (setq source-objs + (if item + (list (est-eval-value-as-object source-cobj) + "=" + item) + (list (est-eval-value-as-object source-cobj)))) + ) + ((eq source 'bos) + (setq source-objs + (list + (est-eval-value-as-object + (or (concord-decode-object + '=id item 'book@ruimoku) + (concord-decode-object + '=id item 'article@ruimoku) + unit)))) + ) + ((memq source '(zob1959 zob1968)) + (if (and (symbolp item) + (setq num (symbol-name item)) + (string-match + "^\\([0-9]+\\)-\\([0-9]+\\)$" num)) + (setq start (string-to-number + (match-string 1 num)) + end (string-to-number + (match-string 2 num))) + (setq start item + end item)) + (if (not (numberp start)) + (setq source-objs + (list + (est-eval-value-as-object unit))) + (if (eq source source0) + (setq source-objs + (list + (list 'link + (list :ref + (format "http://chise.zinbun.kyoto-u.ac.jp/koukotsu/rubbings/%04d" + start)) + start))) + (setq source0 source) + (setq source-objs + (list + (list 'link + (list :ref + (format "http://chise.zinbun.kyoto-u.ac.jp/koukotsu/rubbings/%04d" + start)) + start) + "=" + '(link + (:ref "http://chise.zinbun.kyoto-u.ac.jp/koukotsu/") + "\u4EAC大人\u6587研甲\u9AA8"))) + ) + (setq num (1+ start)) + (while (<= num end) + (setq source-objs + (cons + (list 'link + (list :ref + (format "http://chise.zinbun.kyoto-u.ac.jp/koukotsu/rubbings/%04d" + num)) + num) + source-objs)) + (setq num (1+ num))) + (setq source-objs (nreverse source-objs))) + ) + (t + (setq source-objs + (list (est-eval-value-as-object unit))) + )) + (list* 'res-link + (list :separator " " + :source source :item item) + source-objs) + ) + value))) + (est-eval-value-default value))) + (defun est-eval-value-as-daijiten-page-list (value &optional separator subtype) (if (and (listp value) (listp (cdr value))) @@ -910,7 +1013,10 @@ ((eq format 'space-separated-ids) (est-eval-value-as-space-separated-ids value)) ((eq format 'space-separated-domain-list) - (est-eval-value-as-domain-list value)) + ;; (est-eval-value-as-domain-list value) + (est-eval-value-as-sources value)) + ((eq format 'space-separated-source-list) + (est-eval-value-as-sources value)) ((eq format 'space-separated-creator-name-list) (est-eval-value-as-creators-names value)) ((eq format 'unordered-creator-name-list) -- 1.7.10.4