making a dictionary program

Hi, i'm making a program to develop a strong vocab.

How would I go about storing the words?

I was thinking that using a lexicon. This text document lexicon will collect words and store them in a class to have more functionality... like games... assessments... an all around trainer.

Any of you guys have any ideas on what I would use in general?
Last edited on
std::set<std::string> seems to be an obvious choice for the start. However, you should really provide more details on how this dictionary is supposed to be used.
You could create a structure that every entry is based on. It could have string variables for word, definition, example, classification (noun, adverb, etc), etc.
Well, although map is sometimes called dictionary (as in translation dictionary) and set then roughly corresponds to lexicon, the truth is that there are better choices when it comes exactly to storage of strings. I am not deep into string processing (to date), but you could benefit from reading this, just for the information:
http://en.wikipedia.org/wiki/Trie

IMO (just guessing) tries are not good for searching approximate matches of misspelled words, but they are indeed intended for checking words for spelling, for mapping words to definitions and for auto-completion. They are more efficient in speed in dense dictionaries because many words have common prefix.

Also, to save space under the same assumption (dense dictionary), you can use this:
http://en.wikipedia.org/wiki/Radix_tree

Regards
Topic archived. No new replies allowed.