"hasSuggestions" API
See original GitHub issueI’d like to implement a “loose” spell checking mode, where if a word is not correct but there are no suggestions for it then the spell checker doesn’t yell at the user.
I can currently do something like this to check if there are any suggestions:
const hasSuggestions = !!instance.suggest ( word ).length;
But that would compute all possible suggestions, and I don’t really care about having them available to me at that point in time, so I’d like nspell to have a method that allows me to implement that in a much more efficient way, like:
const hasSuggestions = instance.hasSuggestions ( word );
Which more practically would exit early from unnecessary expensive loops like this one:
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Rules with suggestions must set the `meta.hasSuggestions ...
I'm basically running into an issue where eslint is asking me to set meta.hasSuggestions to true. When I use "react-hooks/exhaustive-deps": ...
Read more >Set the `meta.hasSuggestions` property to `true`. `meta.docs ...
js project with npm run build , I am getting following error, I have tried many solution but nothing is working for me....
Read more >Class ProductSuggestions
This method returns a list of products which were found using the suggested terms as search criteria. The product lookup is being executed...
Read more >Intent.MessageOrBuilder (Google Cloud API gRPC 0.63.0 API)
The voice and text-only responses for Actions on Google. boolean, hasSuggestions(). The suggestion chips for Actions on Google. boolean, hasText().
Read more >MentionsUserPicker (Atlassian JIRA 7.8.2 API)
Method Summary ; com.atlassian.pageobjects.elements.query.TimedCondition, hasSuggestion(String username) ; boolean, hasSuggestions() ; com.atlassian.pageobjects.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Not really. But I’ve changed my mind on this a bit, the added confusion of having words highlighted differently depending on if they’ll have any suggestions or not might not be worth it, like I’ve never seen a two-tier spell checker like that 🤔 Plus performance-wise this may backfire even, as suggestions can be memoized, but if you need to know if there are any suggestions before actually computing any of them, and then later on computing them, you’ll be computing the first suggestion twice rather than once essentially.
So let me close this, eventually if I’ll change my mind on this again I’ll submit a PR or something.
Does your recent work change your need for this feature? It doesn’t make a lot of sense to me (as the 1st result might be bad)