    [:synsem :cat]
    [:synsem :sem :pred]])
 
-(defn index-by-paths [lexicon]
-  (map (fn [path]
-         {:path path
-          :lexemes (map-subset-by-path lexicon path)})
-       index-lexicon-on-paths))
+(defn create-indices [lexicon]
+  (into {}
+        (map (fn [path]
+               [path (map-subset-by-path lexicon path)])
+             index-lexicon-on-paths)))
 
 (defn fo-ps [expr]
   (parse/fo-ps expr fo))

       :lexicon lexicon
       :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))
       :rules rules
       :rule-map (zipmap rules grammar)

       ;; indices from paths to subsets of the lexicon
       :aux2lex
       (map-subset-by-path lexicon-for-generation [:synsem :aux])
       
       :pred2lex ;; map:<pred => subset of lexicon with that pred>
       (map-subset-by-path lexicon-for-generation [:synsem :sem :pred])
       
       :cat2lex ;; map:<cat => subset of lexicon with that cat>
       (map-subset-by-path lexicon-for-generation [:synsem :cat])}))



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

        ;; indices from paths to subsets of the lexicon
        indices (create-indices lexicon-for-generation)]
        
    {:name "medium"
     :generate {:lexicon lexicon-for-generation}
     :grammar grammar
     :index-fn (fn [spec] (lookup-spec spec indices))
     :language "it"
     :language-keyword :italiano
     :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))
