Skip to content

Commit

Permalink
Automatically reset the parser when text is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
theonlypwner committed Apr 25, 2014
1 parent 4d07572 commit e2c6c28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grammar/Corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def reset(self):

def load_text(self, text, **options):
"""Load some text into the state and return whether there are detections"""
text = transform(text, **options)
self.sequence = SequenceManager(partitionize(text))
self.reset()
self.sequence = SequenceManager(partitionize(transform(text, **options)))
# Do checks
self.do_checks_all()
# Were there any corrections?
Expand Down
1 change: 0 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def setUp(self):
self.parser = grammar.CorrectionManager()

def load(self, text, **kwargs):
self.parser.reset()
options = self.options
options.update(kwargs)
if self.parser.load_text(text, **options):
Expand Down

0 comments on commit e2c6c28

Please sign in to comment.