southdoor
southdoor

Reputation: 441

Why can't I add word in a trie via pygtrie?

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!

Upvotes: 0

Views: 666

Answers (1)

jasonharper
jasonharper

Reputation: 9622

This trie implementation provides the same interface as a dict. Your add function would simply be mytrie[key] = value.

Upvotes: 3

Related Questions