Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a on-screen virtual keyboard. I want to add an additional functionality of adding text suggestions with every word so that user is able to select his/her desired word easily without typing the entire word. I want to know how should I achieve this functionality using C#? I have developed my keyboard on Windows Form, and want to display suggested words in that form, for the user to select. Please help.


P.S. I don't know if this explains my problem or should I need to add more detail before my question is being reported?
Posted
Updated 27-Jun-17 22:50pm
v2

1 solution

You will obviously need a dictionary of words (dictionary not in the meaning of the class). I would suggest the OpenOffice-Dictionaries (LGPL License):
https://wiki.openoffice.org/wiki/Dictionaries[^]

To be able to show those matching words that occur most often in the language at the top of the list of suggestions, you would also need data on word frequencies. The best source for this that I know of is here:
http://corpora.informatik.uni-leipzig.de/download.html[^]
(Excerpt from the Conditions of use: Commercial use of the data requires the prior written consent of the Leipzig University department for Natural Language Processing.)

The reason why the lists of word-frequencies doesn't replace the dictionary: The words stem from the internet. There are quite some non-words in these lists. I would download several lists from there (from different years and sources), aggregate them and then filter out those words that are rather infrequent and/or don't appear in the dictionary (you'll probably have to experiment a bit).

Then you would have to:
- Load these words and their frequency-count.
- Implement an algorithm that searches as quickly as possible for those words which start with the substring that the user already typed (see "binary search").
- Sort the matching words by their frequency and display them to be selected.
 
Share this answer
 
Comments
Member 11485559 26-Apr-15 8:40am    
Thank you so much for your response and help. It really helped me achieving my task. Thank you.
Sascha Lefèvre 26-Apr-15 9:18am    
You're welcome! Thank you for your feedback and for accepting my answer, glad I could help :)
Member 13267055 28-Jun-17 4:54am    
please can you send me the code at marc_habib_93@hotmail.com

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