 (declare over)
 
 (defn create-trigram-map [args index grammar bigrams]
-  (if (< (+ 2 index) (.size args))
+  (if (< (+ 2 index) (count args))
     (do
       (merge
        {[index (+ 3 index)]

  (over/over grammar left right))

(defn create-ngram-map [args left ngrams grammar split-at x]
  (log/debug (str "create-ngram-map: left:" left ";split-at:" split-at "; size:" (.size args) "; x:" x))
  (if (< (+ left (- split-at 2))
         (/ (.size args) 2))
    (lazy-cat
     (let [left-parses (get ngrams [left (+ left (- split-at 0))] '())
           right-parses (get ngrams [(+ left split-at 0) (- (.size args) 0)] '())]
       (if (and (not (empty? left-parses))
                (not (empty? right-parses)))
         (over grammar left-parses right-parses)))

                                    (create-xgram-map args (- x 1) 0 grammar))]
               (cond
                (= x 3) (create-trigram-map args index grammar nminus1grams)
                (< (+ x index) (+ 1 (count args)))
                (let [runlevel (if runlevel runlevel 0)]
                  (log/debug (str "create-xgram-map: x=" x "; index=" index "; runlevel=" runlevel))
                  (log/debug (str "  -> create-ngram-map(index:" index ";split-at: " 1 ";x:" x))
