 (def word-pattern #"\S+")
 (def generated-sentence-length 30)
 (def prefix-length 3)
+(def retries 5)
 
 (def table (ref {}))
 (def starters (ref []))

            word
            (recur (rest c) (- i weight)))))
(defn pick-next-word [prefix t]
    (when-let [candidates (t prefix)]
        (select candidates
            (rand-int (reduce + 0 (vals candidates))))))
(defn further-stream-of-shite [prefix t]
    (lazy-seq
        (when-let [c (pick-next-word prefix t)]
            (cons c (further-stream-of-shite (concat (rest prefix) [c]) t)))))
(defn stream-of-shite [prefix t]
    (concat prefix (further-stream-of-shite prefix t)))
(defn generate-sentence []
    (take generated-sentence-length (stream-of-shite
        (nth @starters (rand-int (count @starters)))
        @table)))

(defn value-or-default [value default]
    (if (nil? value) default value))

    (:gen-class)
    (:use
        [clojure.java.io]
        [clojure.string :only [join]]
        [irclj.core])
)

