'hm'
This commit is contained in:
parent
12ee630892
commit
6a5cbc89ee
@ -10,9 +10,8 @@ class automata:
|
||||
self.state = '0'
|
||||
|
||||
def __repr__(self):
|
||||
return('%s\n\n%s\n\n%s\n\n' % (self.storage, self.accepting_states, self.state))
|
||||
return('%s\n\n%s\n\n%s\n\n' % (self.storage, self.accepting_states, self.state))
|
||||
|
||||
|
||||
def add_node(self, line):
|
||||
node = line.split(' ')
|
||||
if len(node) == 3:
|
||||
@ -21,7 +20,7 @@ class automata:
|
||||
self.accepting_states.append(node)
|
||||
|
||||
def test_string(self, text):
|
||||
self.state = '0'
|
||||
self.state = '0'
|
||||
for i in text:
|
||||
self.state = self.get_node_transition([self.state, i])
|
||||
if self.state == None:
|
||||
@ -48,4 +47,4 @@ f = open(sys.argv[1], 'r')
|
||||
|
||||
for line in f:
|
||||
print(auto.test_string(line))
|
||||
print(auto)
|
||||
print(auto)
|
||||
|
Loading…
Reference in New Issue
Block a user