Home

Awesome

SymSpell

Implementation in Python3

The idea is to use Levenshtein distance to correct words, but only using the delete operation (without insertion or transposition). Since the delete cost is lower, the larger the dictionary the more computations are spared.

The algorithm is as follows:

  1. Parameters : max_distance, words_list
  2. Initiate Dictionary
  3. for word in words_list:

Once the dictionary has been built, to correct a word: