finds anagram classes for a dictionary of words