Anagram generaliser