Trubit customer data in Trie.
-
trie - Trie class
-
trie_builder - builds Trie data from a text file
-
trie_searcher - search for prefix keyword
-
trie_searcher_suffix - search for suffix, after matching prefix
from trie import Trie
# Creates a Trie object
trie_obj = Trie()
# Inserts 'read' into the trie.
trie_obj.insert("read")
# Returns True because 'read' is a word in the trie.
trie_obj.search("read")
# Returns True because 're' is a prefix in the trie.
trie_obj.starts_with("re")