Less error prone

This commit is contained in:
2022-01-19 08:05:43 -08:00
parent cd5b1cbb8a
commit 6e0720c3b3
8 changed files with 284 additions and 308 deletions

View File

@@ -91,7 +91,7 @@
(conj matches name))))
(filter #(<= (second %) threshold))
(sort-by second)
ffirst)
first)
word-set (set (filter (complement str/blank?) (str/split (.toLowerCase invoice-client-name) #"[\s:\-]" )))
client-word-match (->> clients
@@ -108,7 +108,7 @@
(filter (fn [[_ c]] (> c 0)))
(sort-by (fn [[_ c]] c))
reverse
ffirst)]
first)]
(or fuzzy-match client-word-match))))
(defn best-location-match [client text full-text]