From: MORIOKA Tomohiko Date: Fri, 20 May 2022 08:22:33 +0000 (+0900) Subject: (est-eval-value-as-object-with-description): New function. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=56afce8243db34dcb7e956b171f0d81949d40dfa;p=chise%2Fest.git (est-eval-value-as-object-with-description): New function. (est-eval-value-as-entry-character-list): New function. (est-eval-apply-value): Use `est-eval-value-as-entry-character-list' to support new formats `entry-character-list' and `unordered-entry-character-list'. --- diff --git a/est-eval.el b/est-eval.el index 10ff991..f4d693d 100644 --- a/est-eval.el +++ b/est-eval.el @@ -388,6 +388,27 @@ (mapconcat #'char-to-string ret "")) (est-eval-value-as-object value)))) +(defun est-eval-value-as-object-with-description (value + object feature-name + &optional lang uri-object list-props) + (let (ret) + (cond + ((characterp value) + (setq ret (or (get-char-attribute value 'description) + (get-char-attribute value 'hdic-syp-description) + (get-char-attribute value 'hdic-ktb-description))) + ) + ((concord-object-p value) + (setq ret (concord-object-get value 'description)) + )) + (if ret + (list 'list nil + (est-eval-value-as-object value) + (est-eval-list ret + object feature-name + lang uri-object list-props)) + (est-eval-value-as-object value)))) + (defun est-eval-value-as-location (value) (let (ret) (if (and (concord-object-p value) @@ -605,6 +626,28 @@ (error (format "%s" value))) (format "%s" value))) +(defun est-eval-value-as-entry-character-list (value + object feature-name + &optional separator subtype + lang uri-object list-props) + (if (and (listp value) + (listp (cdr value))) + (condition-case nil + (let (props) + (if separator + (setq props (list :separator separator))) + (if subtype + (setq props (list* :subtype subtype props))) + (list* 'list props + (mapcar (lambda (cell) + (est-eval-value-as-object-with-description + cell + object feature-name + lang uri-object list-props)) + value))) + (error (format "%s" value))) + (format "%s" value))) + ;; (defun est-eval-value-as-ids (value) ;; (if (listp value) ;; (list 'ids nil (ideographic-structure-to-ids value)) @@ -1010,6 +1053,18 @@ (est-eval-value-as-object-list value nil 'unordered-list)) ((eq format 'unordered-composition-list) (est-eval-value-as-composition-list value nil 'unordered-list)) + ((eq format 'entry-character-list) + (est-eval-value-as-entry-character-list + value + object feature-name + nil nil + lang uri-object list-props)) + ((eq format 'unordered-entry-character-list) + (est-eval-value-as-entry-character-list + value + object feature-name + nil 'unordered-list + lang uri-object list-props)) ((eq format 'space-separated-ids) (est-eval-value-as-space-separated-ids value)) ((eq format 'space-separated-domain-list)