barrust / pyspellchecker

Pure Python Spell Checking http://pyspellchecker.readthedocs.io/en/latest/
MIT License
694 stars 101 forks source link

Any solution on how Named Entities can be skipped in the utility? #106

Open katreparitosh opened 3 years ago

katreparitosh commented 3 years ago

Hi,

First of all, thanks for creating such a useful utility.

I came across cases where it gave incorrect suggestions (false positives) for named entities. I understand that the current functionality doesn't consider Named Entities as separate processing. See examples below:


Example 1: Here, "DC" is corrected to "do"

image


Example 2: Here, "abdalati" is replaced with the same word "abdalati"

image

Does the dictionary contain this word as a meaningful word?


Would love to know your thoughts/suggestions/advice on this?

Regards, Paritosh

barrust commented 3 years ago

You are correct, this library does not take part of speech into account.

It is possible to add those entities into the dictionary that you are leveraging so that it doesn't call it as a false positive. As for your second example, it would only return the same word if it was either provided in the dictionary or there were no suggestions.