From 94cc8f0f9a537cbe5d64ddf6d4aed5c135ad73d1 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sat, 30 Nov 2019 16:24:07 -0800 Subject: [PATCH] forgiveness. --- src/clj/auto_ap/parse.clj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/parse.clj b/src/clj/auto_ap/parse.clj index cd6b0908..6b2eceb9 100644 --- a/src/clj/auto_ap/parse.clj +++ b/src/clj/auto_ap/parse.clj @@ -19,6 +19,7 @@ (defn extract-template ([text template] + (println "template" template) (if (:multi template) (mapcat #(extract-template % text (dissoc template :multi)) @@ -37,12 +38,15 @@ (first (map second (re-seq v full-text)))) str/trim ) [value-parser parser-params] (-> template :parser k)] - (assoc result k (u/parse-value value-parser parser-params value)))) + (assoc result k (try (u/parse-value value-parser parser-params value) + (catch Exception e + (println e)))))) {:vendor-code (:vendor template) :text text :full-text full-text}))]))) (defn parse [text] + (println "Parsing PDF " text) (reset! last-text text) (->> t/pdf-templates (filter (partial template-applies? text))