This commit is contained in:
deadsmond 2019-11-24 21:31:39 +01:00
parent 34f586495a
commit ef4606bf92

View File

@ -21,12 +21,12 @@ class automata:
for i in text: for i in text:
self.state = self.get_node_transition([self.state, i]) self.state = self.get_node_transition([self.state, i])
if self.state == None: if self.state == None:
return 'FALSE' return 'FALSE none %s' % text
if self.state in self.accepting_states: if self.state in self.accepting_states:
return 'TRUE' return 'TRUE %s' % text
else: else:
return 'FALSE' return 'FALSE %s' % text
def get_node_transition(self, query): def get_node_transition(self, query):
for i in self.storage: for i in self.storage: