Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It takes too long time to return an answer on a corner case #16

Open
SanyueHan opened this issue Nov 14, 2021 · 1 comment
Open

It takes too long time to return an answer on a corner case #16

SanyueHan opened this issue Nov 14, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@SanyueHan
Copy link

It seems that you implemented some algorithm that has a complexity related to the length of the input for "dictionary.lookup()", for example, the following script takes seconds to return an answer:

from spylls.hunspell import Dictionary

HUNSPELL_DICT = Dictionary.from_files('en_US')

text = "-" * 40
print(HUNSPELL_DICT.lookup(text))

I know this may not be an expected input for your design, but I suggest adding some shortcut to reduce the processing time for this kind of input that is obviously invalid

@zverok
Copy link
Owner

zverok commented Nov 20, 2021

I will happily accept the PR :)
(Just keep in mind that the first and the main goal of spylls is to "demonstrate how the algorithm is structured", so the guards for edge cases should be carefully designed to not obscure the main flow)

@zverok zverok added the enhancement New feature or request label Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants