nltk.Trie.__init__

Trie.__init__(strings=None)[source]

Builds a Trie object, which is built around a defaultdict

If strings is provided, it will add the strings, which consist of a list of strings, to the Trie. Otherwise, it’ll construct an empty Trie.

Parameters:strings (list(str)) – List of strings to insert into the trie (Default is None)