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.