-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fill autocomplete lists from selected dictionaries #305
Comments
If you mean Notepad++'s auto-complete I believe the biggest obstacle would be the inability to modify auto-completion within Notepad++ via plugins. The second problem is to figure out if spell-checking dictionaries are suitable for this functionality because auto-completing with suggestion list for example might not produce the desired outcome but adding whole dictionary to list of auto-completions might result in a performance problem. |
The key here would definitely be storing the dictionary in a trie data structure and pre-selecting all possible auto-completions using the trie before passing the list into Scintilla's AutoCShow method. Tries are perfectly designed for efficient auto-completion and can solve this sort of problem efficiently even in Python. For a case-insensitive trie (needed to allow case-insensitive lookup in a dictionary), the implementation is a bit more complicated but not too bad. I'm working on implementing this basic functionality in PythonScript and maybe later I can circle back and see about trying to implement it here in C++. Here's a screenshot of the dictionary autocompletion script suggesting words from the 99369-word Merriam-Webster English |
FYI: @molsonkiko was prompted to this follow-on from this N++ Community discussion, which includes another user "from the wild" who is interested in this feature. My further comment would be: to save memory (in @molsonkiko's suggestion), and to improve performance in general, you could not use (or populate) your autocomplete dictionary, except when the user has that option enabled on your plugin. And if you cannot get access to N++'s shortcut to trigger auto-completion (that is, if you cannot append to Notepad++'s list when N++ tries to autocomplete), you could have your own menu entry (which the user could define a shortcut for using Shortcut Mapper), so that if the user wanted, they could do their own dictionary-auto-complete on-demand with their own favorite shortcut. |
I have not been able to append to Notepad++ auto-complete lists, but you use the Scintilla By contrast, I have a few plugins (QuickText and TagLEET) that do autocomplete and I have some PythonScripts injecting autocomplete too (for a Python IDE-like feature) but their lists are very small so after typing a few characters and exhausting the possibilities in my "custom" lists, the Notepad++ "native" autocompletion for the given language (or word complete from current document) is triggered. Cheers. |
My autocompletion thing with PythonScript is implemented here if people are interested. This can provide some of the desired functionality discussed above. At present it cannot properly parse a Hunspell word list. I may add that feature later. |
Well, as it turns out, apparently generating list of all possible word forms from .aff/.dic is a bit of a mess right now in hunspell (see hunspell/hunspell#404). |
I am looking for a solution to use the existing word captured in the dictionary. Currently the spell check validates the correctness of the word already used but it does not populate the help for auto complete when you use the already captured word in the new document.
Thanks
The text was updated successfully, but these errors were encountered: