barrust / pyspellchecker

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

What is your definition of "long"? #69

Closed snoopyjc closed 4 years ago

snoopyjc commented 4 years ago

"If the words that you wish to check are long, it is recommended to reduce the distance to 1". How many characters do you recommend to use for "long"?

barrust commented 4 years ago

That is a personal preference. If your words are taking a long time using the default distance of 2, then try 1.

See PR #61 as an example of longer words taking lots of time to complete.

snoopyjc commented 4 years ago

Thank you. I just tested it, using my own dictionary, if len(word) >= 14, it starts taking over a second to return, so that's where I start using distance=1. If len(word) > len(longest_word_in_dict)+2, then I don't bother checking the spelling, it's not right.