how can extract all the words that start with a particular letter from wordnet. Example if i type A the wordnet should return all the words that start with letter A.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Easiest way I can see is to download their database from here and then parse the space separated data files (data.adj,data.adv,data.noun,data.verb) for the 5th element in each line and place them into a relevant data structure.
Possibly a Hash table with starting letter as key and each element as an array of words that start with that letter.
Whether you use dynamic arrays or regular arrays and you then first parse of the file to get the number of words of each letter (array size) is up to you.
The following code sample is written in C, and reads through a wordnet datafile and prints the word in question. It is by no means polished and was quickly made.
For further documentation on the WordNet database format see here
If you wanted to use the WordNet C API instead then see the
findtheinfofunction documented here, though I don’t think it is designed to return the sort of information you want using that API call.