 (defn read-lexicon
   "read a lexicon compiled from source by (defn compile-lex) and then written to the database by (defn write-lexicon)"
   [language]
-  (init-db)
   (log/info (str "reading lexicon for language: " language))
   (let [lexemes
         (-> (exec-raw [(str "SELECT canonical, serialized FROM lexeme "

  (:require
   [babel.encyclopedia :refer [sem-impl]]
   [babel.exception :refer [exception]]
   [babel.korma :refer [init-db]]
   [babel.pos :refer [agreement-noun common-noun determiner
                      intransitive modal noun
                      subcat0 subcat1

                                 (canonical, structures, language, serialized)
                          VALUES (?,?::jsonb[],?,?::text[])")
             [canonical
              (db/prepare-array
               (vec (map (fn [lexeme]
                           (json/write-str (dissoc (strip-refs lexeme) :dag_unify.core/serialized)))
                         lexemes)))
              language
              (db/prepare-array
               (vec (map (fn [lexeme]
                           (str (vec (dag_unify.core/serialize lexeme))))
                         lexemes)))
