           ;;(take 2)
           (mapcat partition-by-paragraph)
           (map (fn [text] {:tags #{}
-                          :sentences text}))
+                           :sentences text}))
           (into []))
      :metadata
      {:title     title
       :author    author
       :publisher corpus
-      :year      (Integer/parseInt year)
+      :year      (try (Integer/parseInt year)
+                      (catch Exception e
+                        (println "Caught exception: " e)))
       :basename  (fs/base-name filename ".xml")
       :corpus    corpus
+      :script    script
       :category  [(get ndc-map (str/replace genre #"^NDC" "") "分類なし")]}}))
 
 (s/defn parse-document-seq :- [DocumentSchema]

  [options :- {:corpus-dir s/Str s/Keyword s/Any}]
  (->> (fs/glob (str (:corpus-dir options) "/*.xml"))
       (mapcat parse-document-seq)))

(comment
  (s/with-fn-validation (parse-document-seq "/data/taiyo-corpus/XML/t189506.xml")))

   number :- s/Str
   filename :- java.io.File
   article-loc :- ZipperLocation]
  (let [attrs (:attrs (fz/node article-loc))
        title (or (:題名 attrs) (:title attrs) "")
        author (or (:著者 attrs) (:author attrs) "")
        title-alt (:欄名 attrs)
        style (or (:文体 attrs) (:style attrs))
        script (or (:script attrs) "漢字かな") ;; TODO This can be a corpus-level attribute too. Meiroku is at this level, though. Is this a good default? Should keywordize this!
        genre (or (:ジャンル attrs) "")]
    {:paragraphs
     (->> article-loc
          fz/down
