wolfgarbe / SymSpell

SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
https://seekstorm.com/blog/1000x-spelling-correction/
MIT License
3.12k stars 284 forks source link

Remove an entry? #106

Open NickStrupat opened 3 years ago

NickStrupat commented 3 years ago

Is there a way to remove an entry? I don't see one, but maybe I'm missing it.

wolfgarbe commented 3 years ago

There is currently no "RemoveDictionaryEntry" (as equivalent to CreateDictionaryEntry) to programmatically remove a term from the dictionary. It would have to be similar to CreateDictionaryEntry:

  1. Remove the term from the words list https://github.com/wolfgarbe/SymSpell/blob/master/SymSpell/SymSpell.cs#L220
  2. Create all deletes from the term https://github.com/wolfgarbe/SymSpell/blob/master/SymSpell/SymSpell.cs#L228
  3. Iterate all deletes and remove the term from their suggestions https://github.com/wolfgarbe/SymSpell/blob/master/SymSpell/SymSpell.cs#L237