Seems inefficient to open and traverse through a huge dictionary file for each word.
Some other suggestions:
- Compile all unique words (ignore case), run through the file once checking each word, update your text field with errors.
- You could also store the words in a hash map in memory; most word lists are only a couple mb. This would be a lot more efficient and probably worth thinking about since you're working on a word game (presumably lots of spell checks).
Also check out this for ideas on "corrections":http://norvig.com/spell-correct.html
Yes, but think of the memory it would take up if you loaded ALL the words into RAM.
I just gave the code he asked for. He can decide what to do in the end.
(if that comment was for the OP, and not me, never mind
I recommend you do some culling on the words, because in boggle, not all words are possible, so take out all the ones that aren't neccessary, and see how many are left.
Whether you load them into RAM or go through a file, is up to you.
If you hit performance issues, rethink your design.