def next(self, agents_input):
if self.dot_skipped:
self.mistake_done = False
self.dot_skipped = False
return '.'
output = self.correct_learner.next(agents_input)
if output == ' ':
return ' '
if output == '.':
if self.mistake_done:
self.mistake_done = False
return '.'
else:
self.dot_skipped = True
return random.choice(string.ascii_letters)
if random.random() < self.error_rate:
self.mistake_done = True
return random.choice(string.ascii_letters)
return output
评论列表
文章目录