Word Is In Dictionary or Not

3

1

I am trying to see if a word is in the dictionary or not. Is there any way to do that?

user740858

Posted 2011-05-07T02:58:33.823

Reputation:

are we talking about the data-structure "dictionary"? – Bala R – 2011-05-07T03:00:26.367

The data structure or Language dictionary? – Pepe – 2011-05-07T03:00:29.627

1Language dictionary. So if i put in "efslkjd" it should not say that is a word but if i put in "Thank" in should say it is a word – None – 2011-05-07T03:03:30.800

Do you have an dictionary on your system? On linux, you normally have files called *dict* and/or *spell* on your drive. Depending on your locale, they might contain abbvs. like en-US and similar. To have a starting point, use find/locate: find $(locate -i dict) -size +100k -ls or find $(locate -i spell) -size +100k -ls | grep -i en | grep -i us. Then you analyze the files, which are usually plain text in an easy to guess format. Read the file, fill a map, 10M of RAM is no problem - is it? – user unknown – 2011-05-07T03:43:59.923

i dont think so . i have a mac. – None – 2011-05-07T03:45:40.530

Answers

2

Get a list of (assumingly) English words and put it in a database (probably Sqlite for portability). You can get lists of words here:

http://wordlist.sourceforge.net/

Or here (found at https://stackoverflow.com/questions/824422):

http://www.curlewcommunications.co.uk/wordlist.html

Use a library corresponding to the database of your choice to query the table for a word. Here's a Sqlite engine written in pure Java:

http://sqljet.com/

Jonah

Posted 2011-05-07T02:58:33.823

Reputation: 7 535

I am a beginner to this stuff so I don't really know how to use Sqlite. Are there any easier ways? – None – 2011-05-07T03:18:53.417

@The Waller: Not that are as efficient. There's a tutorial on the Sqljet site here: http://sqljet.com/tutorial.html

– Jonah – 2011-05-07T16:42:50.987