(concord-kanbun-corpus-insert-morpheme): Support comment.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Sat, 21 Sep 2013 11:46:58 +0000 (20:46 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Sat, 21 Sep 2013 11:46:58 +0000 (20:46 +0900)
concord-kanbun-dump.el

index 5866807..2a808ef 100644 (file)
@@ -5,7 +5,9 @@
                         morpheme '->entry@morpheme/canonical))
        (ja-form (concord-object-get morpheme 'ja-form))
        (ja-kana (concord-object-get morpheme 'ja-kana))
                         morpheme '->entry@morpheme/canonical))
        (ja-form (concord-object-get morpheme 'ja-form))
        (ja-kana (concord-object-get morpheme 'ja-kana))
-       (ja-conj-type (concord-object-get morpheme 'ja-conjugation-type)))
+       (ja-conj-type (concord-object-get morpheme 'ja-conjugation-type))
+       (name (concord-object-get morpheme '=name))
+       comment)
     (when entry
       (setq entry (concord-object-get (car entry) '=name)))
     (when word-class
     (when entry
       (setq entry (concord-object-get (car entry) '=name)))
     (when word-class
          (if canonical-form
              (concord-object-get (car canonical-form) '=name)
            entry))
          (if canonical-form
              (concord-object-get (car canonical-form) '=name)
            entry))
+    (setq comment
+         (and name
+              (nth 1 (split-string name "\t;\\s "))))
     (insert
     (insert
-     (format "%s\t%s,%s,%s,%s,%s,*,%s,%s,%s,%s\n"
+     (format "%s\t%s,%s,%s,%s,%s,*,%s,%s,%s,%s%s\n"
             (or entry "*")
             (or (car word-class) "*")
             (or (nth 1 word-class) "*")
             (or entry "*")
             (or (car word-class) "*")
             (or (nth 1 word-class) "*")
             (or (nth 3 word-class) "*")
             (or (nth 4 word-class) "*")
             (or canonical-form "*")
             (or (nth 3 word-class) "*")
             (or (nth 4 word-class) "*")
             (or canonical-form "*")
-            ja-form ja-kana ja-conj-type))))
+            ja-form ja-kana ja-conj-type
+            (if comment
+                (format "\t; %s" comment)
+              "")))))
 
 (defun concord-kanbun-dump-file (source dest-dir)
   (with-temp-buffer
 
 (defun concord-kanbun-dump-file (source dest-dir)
   (with-temp-buffer