                 (let [filtered-v v]
                   (if (not (empty? filtered-v))
                     [k filtered-v]))))
-        lexicon-for-analysis lexicon]
+        lexicon-for-analysis lexicon
+        indices (create-indices lexicon index-lexicon-on-paths)]
     {:name "medium"
+     :index-fn (fn [spec] (lookup-spec spec indices index-lexicon-on-paths))
      :lookup (fn [arg]
                (morph/analyze arg lexicon-for-analysis))
      :morph fo

                        (do
                          (merge tree
                                 (morph-walk-tree tree))))

     :pred2lex ;; map:<pred => subset of lexicon with that pred>
     (map-subset-by-path lexicon [:synsem :sem :pred])

     :cat2lex ;; map:<cat => subset of lexicon with that cat>
     (map-subset-by-path lexicon [:synsem :cat])

     :grammar grammar
     :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))
     :lexicon lexicon
     :index (create-index grammar (flatten (vals lexicon-for-generation)) head-principle)
     }))

(defn parse [surface]

                   (map #(keyword (get-in % [:rule]))
                        grammar)
                   grammar)
     
     :grammar grammar
     :lexicon lexicon
