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

How to exclude Nouns in SymSpell #55

Closed larun1616 closed 5 years ago

larun1616 commented 5 years ago

Is there a way to exclude nouns while correcting for spelling mistakes. When I do a spell check for a paragraph, the names also get changed into some word in the dictionary. Please let me know if there are any options available to implement this.

wolfgarbe commented 5 years ago

Instead excluding nouns from the query try adding them to the dictionary.

aziesmaeili commented 3 years ago

Is there any way to ignore some words with Symspell? We have some acronyms and we want to leave the words unchanged by spell check.

wolfgarbe commented 3 years ago

There is no built-in function to exclude certain words from spelling correction.

The simplest way is to add the acronyms to the dictionary (which is a simple plain text file).

Otherwise you could achieve your goal by preprocessing or modifying the code: For SymSpell.Lookup() you can implement a preprocessing step, which prevents that Lookup is invoked for certain words. For SymSpell.LookupCompound() you would have to modify the code of that method in a way which prevents that Lookup is invoked for certain words.