forgiveness.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user