Click here to Skip to main content
15,921,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
i am going to make a very large list of synonyms for english words to be used in a free microsoft word.

i wanted to know what would be thw best way to handle such a data?? the text document size goes upto 12 mb.

I have two problems :
1.) the list should not be saved in an external file like a text document and must reside inside the program itself (a separate class file).
2.) iam making a word processor so i want the user to view synonyms for a selected word.

what would be the best way to store the words with their synonyms and then retrieve the synonyms for any selected word from the list?

eg : word1 - synonym1. synonym2, etc
word2 - synonym1. synonym2, etc
word2 - synonym1. synonym2, etc

but which collection type would be best suited for this operation?
Posted

1 solution

I would expect a dictionary is the only choice here, with each word pointing to a list of words. I'd expect to store this using ids for each word, so you don't have the same words appearing over and over again, at least in the code that creates the list.

This is in fact the only collection that makes any sense at all, perhaps you need to do some reading first so you understand the different types of containers that exist, how they work, what their strengths are, etc ?
 
Share this answer
 
Comments
amit_upadhyay 29-Jul-10 21:56pm    
i thought about using dictionary, but then a dictionary will allow only as many synonyms as specified in the arguments list. But you see some words might have 2 synonyms, some 3 meanings, so what to do?
amit_upadhyay 29-Jul-10 21:56pm    
we can create an array of strings as an argument right??

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