#Sentence Tree
#The sentence tree is a special data structure that can group sentences together n a space optimized tree
#This means that, when a sentence is split by spaces, using the .split() method of strings,
#the tree can storage and look up these words in N words per sentence.
#The tree specifically uses dictionaries for this purpose as opposed to nodes
class SentenceTrie:
def __init__(self):
self.trie = {}
def __repr__(self):
return str(self.trie)
def __str__(self):
return str(self.trie)
def statement(self, phrase):
pass
def has_statement(self, phrase):
pass
""" f = SentenceTrie()
=> None
f.statement("Hello Aarsh what's up?")
=> None
f.trie
=> {'Hello': {'Aarsh': {"what's": {'up?': {}}}}}
f.statement("Want to play table tennis?")
=> None
f
=> {'Hello': {'Aarsh': {"what's": {'up?': {}}}}, 'Want': {'to': {'play': {'table': {'tennis?': {}}}}}}
f.statement("Hello world!")
=> None
f.trie
=> {'Hello': {'Aarsh': {"what's": {'up?': {}}}, 'world!': {}}, 'Want': {'to': {'play': {'table': {'tennis?': {}}}}}}
f.has_statement("Hello world!")
=> True
f.has_statement("Hello world")
=> False
"""