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
Any suggestion on how to use this library for real-time word suggestions? #43
Comments
I think this relates to #40 in that the suggest feature is definitely very computationally slow. There may be room for optimization there but due to being a port the algorithm is what it is. I think this is a good suggestion though and goes along with the linked PR. I have been thinking of adding some kind of overload to the suggest feature to accept some optional arguments such as a cancellation token to do away with the weird timer logic, but also I think your suggestion of returning after reaching an upper limit of suggestions may be a good one. |
The cancellation token could actually be very helpful in my application, especially in conjuction with the use of an upper limit of suggestions. For the time being I suppose I could just override subsequent calls by halting the thread I run the Suggest method on and wait only for the latest call to terminate and see how it goes. It might not be as performant as I hoped for, but at least it shouldn't freeze the UI while typing. |
Let me know if this release candidate works for you all: https://www.nuget.org/packages/WeCantSpell.Hunspell/4.0.0-rc01 |
I'm refactoring the CancellationToken to be an argument of the Check and Suggest methods instead of a property on options as I think that makes a lot more sense. |
@ACCIAI0 See if the new release works better for you: https://www.nuget.org/packages/WeCantSpell.Hunspell/4.0.0 |
I'm trying to use WeCantSpell to create an autocorrect feature for a project I'm working on. I call WordsList.Suggest every time a new letter is added/removed from the word I'm writing but the results are generated very slowly, the more letters i feed into the method, the more time it takes to compute a result. Is there any way I can make it run faster? Is there a way to limit the number of words to retrieve as suggestions?
The text was updated successfully, but these errors were encountered: