Store the words in a Trie instead of a dict