             [clojure.data.json :as json]
             [clojure.string :as s]
             [spicerack.core :as spicerack]))
-
 
 (def DICTIONARY-FILENAME "resources/dictionary.txt")
 (def POSTINGS-LIST-FILENAME "resources/postings.txt")

  Dictionary file: term\tdocument_frequency
  Postings list file: term\tpost1;post2;"
  [term-postings-mapping]
  (with-open [dictionary-file (io/writer DICTIONARY-FILENAME)]
    (let [postings-list-map (spicerack/open-hashmap MAPDB POSTINGS-LIST-DB)]
      (doseq [[term postings] term-postings-mapping]
        (.write dictionary-file
                (str term "\t" (count (distinct postings)) "\n"))

  "Main function for creating indicies.
   Reads in datafile, tokenizes, sorts, and writes to files"
  [jsonfile]
  (io/delete-file MAPDB-FILENAME)
  (let [docs (doc-seq-from-file jsonfile)
        token-seq (token-seq-from-docs docs)
        url-seq (create-url-seq docs)]
