I want to build a trie to record the phrases. Thus the unit is word instead of character. And I have found a promising implementation by google here. But according to their documentation, there is no add
function. I wonder how can I add/insert a word into a trie? Thanks in advance!
This trie implementation provides the same interface as a dict. Your add
function would simply be mytrie[key] = value
.