Generates perfect pangrams (sentences where every letter of the alphabet is represented exactly once).
Improvements:
-
The heuristic could be developed further. In particular, I think vowel density could help out.
-
You could implement some memoization of word combination, or figure out another way to filter duplicate permutations of words.
-
The dictionary could be preprocessed such that it automatically filters all words with duplicate letters, and other optimizations.
-
Dictionary could be preprocessed such that all words are sorted by rarity of letter. Words containing the rarest letter are put in the priority queue first, and then when popped off, matched with all words that contain the next rarest letter that the word doesn't have.