Jan E. wrote in post #1054912:
> Hi,
>
> I don't really get what you're trying to do. Do you want to store the
> dictionary data as structured text and then parse it and put it into a
> Ruby hash? And do you want to use Ruby's syntax to make up your own data
> format?
>
> If so: Why not use a common data format like XML or JSON? Those are
> mature and already have parsers. And if you're going to have a lot of
> data, you're better off using a database, anyway.

Hey, thanks for the reply. I've been practising my ruby but if you have 
a JSON or XML solution I will look at / learn those too as Ruby is often 
used in tandem with XML and JSON

So I'm looking to start up a text file where I can type words and then 
its corresponding definition on the same line. For example.

In dictionary.txt I would have
word1 - definition1;
word2 - definition2;

Then in my ruby program I will have a hash which will have the key as 
the word and the value as the definition.

From there I was thinking of adding additional functionality such as a 
random definition selector and then I could type the applicable word. I 
was also thinking that I could provide 4 words and a definition and see 
if I knew which one matched.

-- 
Posted via http://www.ruby-forum.com/.