                                "ok."))))
         result)))
    (filter #(not (= :fail %)))))
-
-(defn show-spec [spec]
-  (str "cat=" (get-in spec [:synsem :cat])
-       (if (get-in spec [:rule])
-         (str "; rule=" (strip-refs (get-in spec [:rule]))))
-       (if (not (= (get-in spec [:synsem :agr] ::none) ::none))
-         (str "; agr=" (strip-refs (get-in spec [:synsem :agr]))))
-       (if (not (= (get-in spec [:synsem :sem :pred] ::none) ::none))
-         (str "; pred=" (strip-refs (get-in spec [:synsem :sem :pred]))))
-       (if (get-in spec [:synsem :subcat :1 :cat])
-         (str "; subcat1=" (strip-refs (get-in spec [:synsem :subcat :1 :cat]))))
-       (if (get-in spec [:synsem :subcat :2 :cat])
-         (str "; subcat2=" (strip-refs (get-in spec [:synsem :subcat :2 :cat]))))
-       (if (get-in spec [:synsem :subcat :3 :cat])
-         (str "; subcat3=" (strip-refs (get-in spec [:synsem :subcat :3 :cat]))))
-       (if (not (= (get-in spec [:phrasal] ::none) ::none))
-         (str "; phrasal=" (strip-refs (get-in spec [:phrasal]))))))

(declare lightning-bolts)
(declare comp-paths)
(declare gen)
(declare show-spec)

(defn generate
  "Return one expression matching spec _spec_ given the model _model_."

                       (assoc-in candidate-parent [:head] head))))
           (lightning-bolts model spec depth max-depth (rest candidate-parents))))
        []))
    (shufflefn (get-lexemes model spec))))

(defn add-comps-to-bolt
  "bolt + paths => trees"
