Closed diegoepaezm closed 5 years ago
@diegoepaezm, I would love to see an example of this that allows for all the different types of misspellings! A quick and dirty set of example code with mini tests would be great!
Hmm I have an example in Java. But you can consult the wikipedia page to find out how to use dynamic programming to calculate the levenshtein distance between two strings:
https://en.wikipedia.org/wiki/Levenshtein_distance
And I guess an example with a Trie would be like this one: https://github.com/umbertogriffo/Trie
The spelling checker takes a lot of time checking the spelling of words. Especially if a word is not in the dictionary it takes even longer, which can make spelling check of several words a really long process. Besides the current approach only allows only search up to 2 in distance of levenshtein. Thus it would be convenient to: