'hm'
This commit is contained in:
parent
75b7052e7c
commit
2dfadfd588
@ -58,13 +58,15 @@ class automata:
|
||||
def get_node_transition(self, q, i):
|
||||
result = []
|
||||
# if the node exists
|
||||
if self.graph[q]:
|
||||
try:
|
||||
# search through all its connections to find value
|
||||
for connections in self.graph[q]:
|
||||
for value in connections:
|
||||
if value == i:
|
||||
# append next node
|
||||
result.append(connections[value])
|
||||
except KeyError:
|
||||
return result
|
||||
# return list of next nodes
|
||||
return result
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user