into a finite state automaton like this: compile the necessary wordlists into tries, and then generate from a particular phrase all the anagrams of that phrase that fit within the wordlists and ...