Add max length matching for WordTrie