                                ". Complements tried were: " (morph complement-candidate-lexemes)))
                   
                 ;; TODO: show warn about not finding any phrasal complements, as well as not finding any lexical complements.
-                (log/debug (str " fail-paths:"))
                 (vec (map (fn [lexeme]
                             (log/debug (str " path in bolt: " path))
-                            (log/debug (str " value of bolt at path: " (get-in bolt path)))
-                            (log/debug (str " value of gender at path: " (get-in bolt (concat path [:synsem :agr :gender])))))
+                            (log/debug (str " cat@" path " = " (strip-refs (get-in bolt (concat path [:synsem :cat])))))
+                            (log/trace (str " sem@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem])))))
+                            (log/debug (str " pred@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem :pred])))))
+                            (log/debug (str " agr@" path " = " (strip-refs (get-in bolt (concat path [:synsem :agr]))))))
                           complement-candidate-lexemes))))
-            (do (log/debug (str "add-complement after adding complement: " (morph return-val)))
+            (do (log/debug (str "add-complement after adding complement: "
+                                (try
+                                  (morph return-val)
+                                  (catch Exception e
+                                    "(exception caught)"))))
                 return-val))))
 
       ;; path doesn't exist in bolt: simply return the bolt unmodified.


(declare lightning-bolt)
(declare generate-all)

(defn generate [spec grammar lexicon index morph]
  (first (take 1 (generate-all spec grammar lexicon index morph))))

                                          (string/join ","
                                           (map (fn [child]
                                                  (str "[" (:rule child) "]"
                                                       "'"

                                                       (try
                                                         (morph child)
                                                         (catch Exception e
                                                           "(exception caught)"))

                                                       "'"
                                                       ))
                                                phrasal-children))))
                          (over/overh parent phrasal-children morph)))
