Suggestion not provided if the word to check ends up with a number
coorasse opened this issue · 2 comments
coorasse commented
sc = DidYouMean::SpellChecker.new(dictionary: [:emailaddress3])
sc.correct('emailAddress')
=> [:emailaddress3]
sc.correct('emailAddresseswe')
=> [:emailaddress3]
sc.correct('emailAddress3')
=> []
I'd expect did_you_mean to be able to suggest emailaddress3
for emailAddress3
mrzasa commented
I think it's not about the number at the end. It seems that a suggestion is not provided if you try to correct a correct word (i.e. one that is in the dictionary). Take a look:
sc = DidYouMean::SpellChecker.new(dictionary: [:emailaddress])
# => #<DidYouMean::SpellChecker:0x000055eafbd4cb00 @dictionary=[:emailaddress]>
sc.correct('emailAddress')
# => []
sc.correct('emailAddres')
# => [:emailaddress]