From 6e9ec4ee53af04a47420e9ed1615d4f17038166d Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Fri, 13 Sep 2013 09:07:24 +0900 Subject: [PATCH] (concord-kanbun-add-word-class): Add new argument `word-subclass3'. (concord-kanbun-add-morpheme): Likewise. (concord-kanbun-parse-corpus-line): Add word-subclass3 to return value. --- concord-kanbun-dic.el | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/concord-kanbun-dic.el b/concord-kanbun-dic.el index ea9416a..1758998 100644 --- a/concord-kanbun-dic.el +++ b/concord-kanbun-dic.el @@ -73,7 +73,8 @@ (defun concord-kanbun-add-word-class (word-superclass word-class - word-subclass1 word-subclass2) + word-subclass1 word-subclass2 + word-subclass3) (let (wc-name wc-cobj wc-name-id) (when (and word-superclass (not (string= word-superclass "*"))) @@ -89,7 +90,11 @@ (when (and word-subclass2 (not (string= word-subclass2 "*"))) (setq wc-name - (format "%s,%s" wc-name word-subclass2)))))) + (format "%s,%s" wc-name word-subclass2)) + (when (and word-subclass3 + (not (string= word-subclass3 "*"))) + (setq wc-name + (format "%s,%s" wc-name word-subclass3))))))) (unless (setq wc-cobj (concord-decode-object '=name wc-name 'word-class@zh-classical)) @@ -102,6 +107,7 @@ (defun concord-kanbun-add-morpheme (entry word-superclass word-class word-subclass1 word-subclass2 + word-subclass3 canonical-form ja-form ja-kana ja-conj-type) (let* (entry-cobj @@ -110,9 +116,16 @@ mm-name mj-name mj-id mj-cobj) (when entry - (setq wc-name (format "%s,%s,%s,%s" - word-superclass word-class - word-subclass1 word-subclass2)) + (setq wc-name + (if (or (null word-subclass3) + (string-equal word-subclass3 "*")) + (format "%s,%s,%s,%s" + word-superclass word-class + word-subclass1 word-subclass2) + (format "%s,%s,%s,%s,%s" + word-superclass word-class + word-subclass1 word-subclass2 + word-subclass3))) (setq mm-name (format "%s (%s) [%s]" entry canonical-form wc-name)) (setq mj-name (format "%s (%s (%s),%s)" @@ -131,7 +144,8 @@ (list canonical-entry-cobj)))) (when (setq wc-cobj (concord-kanbun-add-word-class word-superclass word-class - word-subclass1 word-subclass2)) + word-subclass1 word-subclass2 + word-subclass3)) (concord-object-put mj-cobj '->word-class (list wc-cobj))) (concord-object-put mj-cobj 'ja-form ja-form) (concord-object-put mj-cobj 'ja-kana ja-kana) @@ -142,7 +156,7 @@ (let* ((ret (split-string string "\t")) (ret2 (split-string (nth 1 ret) ","))) (list (car ret) - (car ret2)(nth 1 ret2)(nth 2 ret2)(nth 3 ret2) + (car ret2)(nth 1 ret2)(nth 2 ret2)(nth 3 ret2)(nth 4 ret2) (nth 6 ret2) (nth 7 ret2)(nth 8 ret2)(nth 9 ret2)))) -- 1.7.10.4