               (for [[k v] @lexicon]
                 (let [filtered-v v]
                   (if (not (empty? filtered-v))  ;; TODO: this empty-filtering should be done in lexicon.cljc, not here.
-                    [k filtered-v]))))]
+                    [k filtered-v]))))
+        indices (create-indices lexicon index-lexicon-on-paths)]
     {:name "medium"
 
+     :index-fn (fn [spec] (lookup-spec spec indices index-lexicon-on-paths))
      ;; Will throw a clojure/core-level exception if more than 1 rule has the same :rule value:
      :grammar-map (zipmap
                    (map #(keyword (get-in % [:rule])) grammar)

   #?(:cljs [babel.logjs :as log]) 
   [clojure.core.cache :as cache]
   [dag_unify.core :refer (fail? get-in remove-matching-keys unifyc)]))

(declare cache)


                                      (= :it (get-in % [:target])))
                                 v)]
                     (if (not (empty? filtered-v))
                       [k filtered-v]))))}}))

(defn medium []
  (let [lexicon
