Click here to Skip to main content
15,867,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have only recently started with C# (before that I already had experience with Java), so please provide more detailed explanations and in the best case also refer to pieces of code or already existing libraries, classes and/or projects. 
Regarding the problem:
I have programmed a keyboard and now I want to "predict" whole words in single buttons of a virtual keyboard. The buttons should always change when another letter is entered.
Best also a possibility to use whole phrases.
There is already an entry to the same topic however I could not convert it, because it was outdated links and no possibility with me to program.
Please for info. Since the keyboard is likely to be used by German speakers please also show German dictionaries(-suggestions). Thank you very much!


What I have tried:

I already researched in many forms but most of them are outdated (not compatible anymore), or I have no clue how to embed in my existing code.
Posted
Updated 17-Jan-21 16:36pm
Comments
Richard MacCutchan 17-Jan-21 10:23am    
Your first problem is setting up your dictionary of words. You could use a database or in in-memory list, but it will depend on how many words you plan to have in it. The logic then is just using a search to find possible words as the user types each successive letter.

1 solution

There are are a couple of links below for suggestions, in addition to Richard's comment, which is very valid.

In addition to Richard's comments
1) think about 'when you want to start' predictive matching - eg on the 2nd or 3rd character being typed - this speeds up the search a bit
2) to speed up the process for users if they have individual preferences, save the words they used and present them next time

C# winforms combobox dynamic autocomplete - Stack Overflow[^]

IntelliSense TextBox in C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900