Skip to content

Commit

Permalink
Extract name failure, fall back to exact matching
Browse files Browse the repository at this point in the history
When instaparse fails to extract the names from a string, it should just
return the string. This should let the matching fallback to exact string
matching then.
  • Loading branch information
Zack Maril committed Mar 24, 2015
1 parent c24ef9e commit 37e31b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/echelon/text.clj
Expand Up @@ -43,11 +43,11 @@
:timeout
(do
(println (str "Cannot extract name quickly: \"" x"\""))
[])
[[x]])
[]
(do
(println (str "Cannot extract any name: \"" x"\""))
[])
[[[x]]])
(do
(comment
(when (not= 1 (count val))
Expand All @@ -73,4 +73,6 @@
(mapcat extract-name)
distinct))

(extract-names "Google inc.")
[(extract-names "working name")
(extract-names "not.working")
(extract-names "too slow ")]

0 comments on commit 37e31b1

Please sign in to comment.