Click to See Complete Forum and Search --> : C# application interacting with Dictionary.


Sabiyur
January 24th, 2007, 10:26 PM
Hi all,
I am new to c#. And I am trying to write small Word game in c#.
My requirement is to generate a random 4 letter English word.

To accomplish this, I need a free dictionary. And I don't know how a C #program can interact with dictionary...
I heard of MS Word dictionary can be used by any application. How to use that? I am little bit familiar with COM in C++.

Where can I get a dictionary? How to make the c# application interact with this dictionary?

Can you please suggest me...? If possible, please point me some artifice where I can read on this...


Thanks
Sabiyur

dcell59
January 24th, 2007, 10:45 PM
Do you really need something that complex? It seems to me that all you need is a list of words, which you can extract the 4-letter words from.

There is a file on Unix systems called /usr/dict/words, and you can find copies of this by searching on Google for "/usr/dict/words". Then, all you need to do is to read the file and store any words you want to use.

Blacklazy
January 24th, 2007, 10:54 PM
I have a word list with about 70,000 words in it, (attached).

As stated previously, you'll need to create a function to pull out all the words that are 4 bytes, and output them into a new file. You may also want to design the function to only allow words that contain ASCII characters for a-z and A-Z otherwise you are going to end up with some useless "words" like "19th". I recommend that you output them into an XML file it will be much faster then a text file, and a lot easier to read with code.

Sabiyur
January 25th, 2007, 10:14 PM
Thanks a lot for your suggesstions...