summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spellfix.fnl4
1 files changed, 3 insertions, 1 deletions
diff --git a/spellfix.fnl b/spellfix.fnl
index 5ecb870..2507fca 100644
--- a/spellfix.fnl
+++ b/spellfix.fnl
@@ -300,7 +300,9 @@
(local sorted-index
(array.sort index #(< $1.distance $2.distance)))
(local most-similar (. sorted-index 1))
- most-similar.word)
+ (if (< most-similar.distance 3)
+ most-similar.word
+ token))
(str.split string " "))
" "))
(if (~= result string)