replying to emails

This commit is contained in:
Bryce Covert
2018-04-05 22:47:16 -07:00
parent 4eace8144e
commit 26168cd523
5 changed files with 75 additions and 28 deletions

View File

@@ -3,7 +3,9 @@
[clojure.string :as str]
[clojure.java.shell :as sh]
[auto-ap.parse.excel :as excel]
[auto-ap.parse.templates :as t]))
[auto-ap.parse.templates :as t]
[clj-fuzzy.metrics :as m]
))
@@ -50,3 +52,12 @@
"xlsx"
[file filename]
(excel/parse-file file filename))
(defn best-match [companies company-identifier]
(->> companies
(map (fn [company]
[company (apply min (map #(m/jaccard (.toLowerCase company-identifier) %) (:matches company)))]))
(filter #(< (second %) 0.25))
(sort-by second)
ffirst))