From: MORIOKA Tomohiko Date: Fri, 14 Dec 2018 06:36:36 +0000 (+0900) Subject: (concord-turtle-insert-object): New function. X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fchiset.git;a=commitdiff_plain;h=121ed857df1697ad4bacad20ac163225611a8d2c (concord-turtle-insert-object): New function. (concord-turtle-insert-decomposition): New function. (concord-turtle-insert-relations): Use `concord-turtle-insert-object'. (concord-turtle-insert-target-value): Use `concord-turtle-insert-decomposition' for `=decomposition' instead of `concord-turtle-insert-relations'. --- diff --git a/concord-turtle-dump.el b/concord-turtle-dump.el index f6f0b5e..f2cedaa 100644 --- a/concord-turtle-dump.el +++ b/concord-turtle-dump.el @@ -641,6 +641,41 @@ (insert " ;") 'with-separator)) +(defun concord-turtle-insert-object (cell &optional readable) + (if (integerp cell) + (setq cell (decode-char '=ucs cell))) + (cond + ((characterp cell) + (insert (format "%-20s" (chise-turtle-encode-char cell))) + nil) + ((concord-object-p cell) + (insert (format "%-20s" (concord-turtle-encode-object cell))) + nil) + (t + (concord-turtle-insert-char-ref cell '<-formed) + ))) + +(defun concord-turtle-insert-decomposition (value &optional readable) + (let ((lbs (concat "\n" (make-string (current-column) ?\ ))) + base vs lb) + (if (characterp value) + (setq value (list value))) + (if (setq base (pop value)) + (cond ((setq vs (pop value)) + (insert "[ :base ") + (setq lb (concord-turtle-insert-object base readable)) + (insert " ;") + (insert lbs) + (insert " :vs ") + (setq lb (concord-turtle-insert-object vs readable)) + (insert lbs) + (insert "]") + nil) + (t + (setq lb (concord-turtle-insert-object base readable)) + )) + ))) + (defun concord-turtle-insert-relations (value &optional readable) (let ((lbs (concat "\n" (make-string (current-column) ?\ ))) separator cell) @@ -648,20 +683,21 @@ (setq value (list value))) (while (consp value) (setq cell (car value)) - (if (integerp cell) - (setq cell (decode-char '=ucs cell))) + ;; (if (integerp cell) + ;; (setq cell (decode-char '=ucs cell))) (if separator (insert separator) (setq separator (format " ,%s" lbs))) - (cond - ((characterp cell) - (insert (format "%-20s" (chise-turtle-encode-char cell))) - ) - ((concord-object-p cell) - (insert (format "%-20s" (concord-turtle-encode-object cell))) - ) - (t - (concord-turtle-insert-char-ref cell '<-formed))) + ;; (cond + ;; ((characterp cell) + ;; (insert (format "%-20s" (chise-turtle-encode-char cell))) + ;; ) + ;; ((concord-object-p cell) + ;; (insert (format "%-20s" (concord-turtle-encode-object cell))) + ;; ) + ;; (t + ;; (concord-turtle-insert-char-ref cell '<-formed))) + (concord-turtle-insert-object cell readable) (setq value (cdr value))) nil)) @@ -669,8 +705,10 @@ (cond ((eq feature-name-base 'ideographic-radical) (concord-turtle-insert-radical value) ) + ((eq feature-name-base '=decomposition) + (concord-turtle-insert-decomposition value readable) + ) ((or (eq feature-name-base 'ideographic-combination) - (eq feature-name-base '=decomposition) (eq feature-name-base '<-formed) (string-match "^\\(->\\|<-\\)[^*]*$" (symbol-name feature-name-base))) (concord-turtle-insert-relations value readable)