Anagram generalising