From c24fc299da6ef6e8b4aa69ea3194d2680cfb991a Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Wed, 21 Oct 2020 10:41:02 +0900 Subject: [PATCH] (est-eval-value-as-shuowen-radical): New function. (est-eval-apply-value): Use `est-eval-value-as-shuowen-radical' for format `shuowen-radical'. (est-eval-unit): Treat `shuowen-radical' in a similar way to `kangxi-radical'. --- est-eval.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/est-eval.el b/est-eval.el index d395637..65db614 100644 --- a/est-eval.el +++ b/est-eval.el @@ -426,6 +426,15 @@ (format "%c" (ideographic-radical value))) (est-eval-value-as-S-exp value))) +(defun est-eval-value-as-shuowen-radical (value) + (if (and (integerp value) + (<= 0 value) + (<= value 540)) + (list 'shuowen-radical + nil + (format "%c" (shuowen-radical value))) + (est-eval-value-as-S-exp value))) + (defun daijiten-page-number-to-ndl-950498 (page) (+ (/ page 2) (cond ((< page 229) @@ -820,6 +829,8 @@ (est-eval-value-as-kuten value)) ((eq format 'kangxi-radical) (est-eval-value-as-kangxi-radical value)) + ((eq format 'shuowen-radical) + (est-eval-value-as-shuowen-radical value)) ((eq format 'ids) (est-eval-value-as-ids value)) ((eq format 'decomposition) @@ -912,7 +923,8 @@ ((null exp) "") ((consp exp) (cond - ((memq (car exp) '(value decimal hex HEX ku-ten kangxi-radical + ((memq (car exp) '(value decimal hex HEX ku-ten + kangxi-radical shuowen-radical S-exp string default)) (let ((fn (plist-get (nth 1 exp) :feature)) domain domain-fn ret) -- 1.7.10.4