From 995c6fd0c5cf24288d66ba94b763fab620eb9ad3 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 29 Oct 2020 11:11:56 +0900 Subject: [PATCH] =?utf8?q?(ideographic-structure-compare-functional-and-appa?= =?utf8?q?rent):=20-=20Implement=20rule-811:=20=E2=BF=BA=E2=BF=B1=F0=A0=83=8A?= =?utf8?q?BC=20->=20=E2=BF=B1=E2=BF=BA=F0=A0=83=8ACB.=20-=20Implement=20rule?= =?utf8?q?-812:=20=E2=BF=BA=E2=BF=B1=E6=9C=A8B=E4=B8=B6=20->=20=E2=BF=B1=E2=BF?= =?utf8?q?=BA=E6=9C=A8=E4=B8=B6B.=20-=20Implement=20rule-813:=20=E2=BF=BA=E2?= =?utf8?q?=BF=B1LBC=20->=20=E2=BF=B1=E2=BF=B0LCB=20if=20B=20is=20not=20nyou.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ids-find.el | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/ids-find.el b/ids-find.el index ee1ce9d..c7276b7 100644 --- a/ids-find.el +++ b/ids-find.el @@ -778,7 +778,7 @@ COMPONENT can be a character or char-spec." (defun ideographic-structure-compare-functional-and-apparent (structure &optional char conversion-only) - (let (enc enc-str enc2-str new-str new-str-c f-res a-res ret) + (let (enc enc-str enc2-str new-str new-str-c f-res a-res ret code) (cond ((eq (car structure) ?⿸) (setq enc (nth 1 structure)) @@ -1437,6 +1437,70 @@ COMPONENT can be a character or char-spec." 710)) ))) ) + ((eq (car structure) ?⿺) + (setq enc (nth 1 structure)) + (when (setq enc-str + (cond ((characterp enc) + (get-char-attribute enc 'ideographic-structure) + ) + ((consp enc) + (cdr (assq 'ideographic-structure enc)) + ))) + (cond + ((eq (car enc-str) ?⿱) + (cond + ((and (characterp (nth 1 enc-str)) + (or (and (eq (char-ucs (nth 1 enc-str)) #x200CA) + (setq code 811)) + (and (eq (char-feature (nth 1 enc-str) '=>iwds-1) 233) + (characterp (nth 2 structure)) + (eq (char-ucs (nth 2 structure)) #x4E36) + (setq code 812)))) + (unless conversion-only + (setq f-res (ids-find-chars-including-ids enc-str))) + (setq new-str (list ?⿺ + (nth 1 enc-str) + (nth 2 structure))) + (setq new-str-c + (if (setq ret (ideographic-structure-find-chars new-str)) + (car ret) + (list (cons 'ideographic-structure new-str)))) + (if conversion-only + (list ?⿱ new-str-c (nth 2 enc-str)) + (setq a-res (ids-find-chars-including-ids new-str)) + (list enc + f-res + new-str-c + a-res + (list ?⿱ new-str-c (nth 2 enc-str)) + code)) + ) + ((and (characterp (nth 2 enc-str)) + (memq (char-ucs (nth 2 enc-str)) + '(#x706C + #x65E5 #x66F0 #x5FC3 + #x2123C #x58EC #x738B #x7389))) + (unless conversion-only + (setq f-res (ids-find-chars-including-ids enc-str))) + (setq new-str (list ?⿰ + (nth 1 enc-str) + (nth 2 structure))) + (setq new-str-c + (if (setq ret (ideographic-structure-find-chars new-str)) + (car ret) + (list (cons 'ideographic-structure new-str)))) + (if conversion-only + (list ?⿱ new-str-c (nth 2 enc-str)) + (setq a-res (ids-find-chars-including-ids new-str)) + (list enc + f-res + new-str-c + a-res + (list ?⿱ new-str-c (nth 2 enc-str)) + 813)) + ) + )))) + ) ((eq (car structure) ?⿻) (setq enc (nth 1 structure)) (when (setq enc-str -- 1.7.10.4