No, I'm not writing a brute force cracking program, just getting that cleard up (I would have guessed that if someone asked me this).

I actually started making an anagram solver, sort of. It was actually for the game "Bully" and the english lesson where you have to make words from a list of chars, I suck at word games and decided "I would show it". Yeah....

Well I didn't think about where I would actually get this list of "every word in the English Language". I tried a spell checker word set, seems to contain what I think might be syntax rules and other "long" words that dont really come up in word games.

Didn't post it in a help section because I'm not really looking for help, just looking for some insight into how others (I'm assuming there must be a lot of people on here who wrote anagram program at some point) solved this issue.

Dani AI

Generated

For a game-focused anagram solver you don't want an academic dump — you want a compact, playable wordlist. was on the right track: large spell‑checker or OED-style dumps pull in hyphenates, markup, archaica, phrases and odd inflections that make matching slower and give nonsense answers. 's pointer to comprehensive lists is useful for research, and is correct that every dictionary has a different scope; pick the scope that matches the game.

Two practical options work best. Use a curated game list (Scrabble/TWL or Collins-style lists, ENABLE, SCOWL/wordlists or a WordNet-derived lemma list), or start with a larger list and aggressively filter it for the game's rules. Typical filters: strip non‑alphabetic entries, remove multiword or hyphenated tokens, enforce the game’s min/max word length, drop obvious proper nouns, and optionally prune very rare or archaic words. Beware licensing on some curated lists.

Quick, reproducible cleanup (example enforces only a–z, 2–8 letters, lowercased, unique):

tr '[:upper:]' '[:lower:]' < raw.txt \
  | grep -E '^[a-z]{2,8}$' \
  | sort -u > game-words.txt

A simple Python pattern lets you precompute anagram buckets (sorted-letter keys → words) for very fast lookups:

from collections import defaultdict
d=defaultdict(list)
for w in open('game-words.txt'):
    w=w.strip()
    d[''.join(sorted(w))].append(w)
# lookup by key = ''.join(sorted(input_letters))

Two final notes: normalize encoding/diacritics before filtering (iconv or Python unicodedata.normalize) and store by length or precompute buckets to speed searches. That yields a small, accurate list tailored to the game's rules instead of an encyclopedic mess.

Recommended Answers

All 5 Replies

Yeah, I was hoping for just a giant list of every list in the dictionary, each word on a line without the definition. Well I'm using these lists combined:

http://dictionary-thesaurus.com/Wordlists.html

seems to do the job ok (and most importantly beat that game).

Thanks.

>>I was hoping for just a giant list of every list in the dictionary
which dictionary? there are quite a few of them and they all contain a different set of words.

anyway, thou complain too loudly that thou are not creating anything illegal ;)

Sorry forgot about this.
@Ancient Dragon:I was thinking something like the oxford standard dictionary in list form, something suitable for a word game.

: People can jump to conclusions when you ask for 'every word' in the dictionary, I should point out that I have come across really good lists for cracking, they just don't work too well for word games.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.