Implement dictionary using Trie instead of STL unordered_map