I am trying to see if a word is in the dictionary or not. Is there any way to do that?
Word Is In Dictionary or Not
Asked Answered
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:
I am a beginner to this stuff so I don't really know how to use Sqlite. Are there any easier ways? –
Borglum
@The Waller: Not that are as efficient. There's a tutorial on the Sqljet site here: sqljet.com/tutorial.html –
Strychninism
© 2022 - 2024 — McMap. All rights reserved.
*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
orfind $(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? – Myeloid