Sign in to follow this  
yves032784

words..

Recommended Posts

yves032784    160
I'm making a program which requires to search through a list of words....in needs to search through all the words in the dictionary. What would be the fastest way to search through all the words. Also, where can i get a list of all the words in the dictionary? (i did try google)

Share this post


Link to post
Share on other sites
DarkHamster    180
#1. Well, I would probably make a tree where each node has 26 children, one corresponding to each letter, then just follow the tree down. That way access to a word is O(n) where n is the number of letters in the word.

#2. I don't know, but I'm willing to bet you could get one out of Open-Office (an open source office suite including a word processer with spell checking) if you tried hard enough.

Share this post


Link to post
Share on other sites
ekrax    128
i know where you can find a large word list like that. any sort of hacking underground site will have dictionaries like that, that you can just download in plain text. i think they're used for brute force cracking programs or something.

Share this post


Link to post
Share on other sites
iMalc    2466
You sould be able to find some freely available plain text dictionary easily with google. In fact it appears that someone beat me to a link.

You question is however too vague. In order to get the best solution you must provide more info.
How often do you need to search through the dictionary?
What are you searching for?

There could be a ton of reasons for using a dictionary e.g. spell checking, finding a random N-letter word for a word game, finding possible words for a crossword solver, generating a letter frequency table for compression etc etc...
All of these would each be best handled in different ways.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Have a three/four/+ dimensional array. Each letter corresponds to a number. A=0, B=1, C=2... Z=25. The first dim is the first letter. Then the second dim is the second letter of the word etc... Just like sorting.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this