Open dandiep opened 2 years ago
@dandiep Sorry for late response (I am in Kharkiv, Ukraine, you know).
You sure it is infinite loop, not just very long suggestion? On my machine with the French dictionary I tried it took almost 8 min, but eventually returned ['découverte', 'recouverte', 'de couverte', 'de-couverte', 'couverte', 'couverture']
.
Why it takes so long is a different question which I'll investigate at some point. Quick debug shows that nothing "too weird" happens, just with a French dictionary/alphabet and a long word the amount of hypotheses to check is huge; but I need to compare it with what hunspell
does, maybe it optimizes it away somehow (or maybe the Python implementation is just that slow).
Is there anyway to make it opt out of some of the more intensive searching so I can guarantee that this will return quickly?
It seems that for some words the generator from suggest() never finishes. I am using the French dictionary from Firefox as my datasource. This works:
This goes into an infinite loop:
Any ideas/suggestions? Spylls version 0.1.7, Python 3.9.7