Skip to content

Commit

Permalink
Implement the previous exception
Browse files Browse the repository at this point in the history
  • Loading branch information
theonlypwner committed Jun 26, 2014
1 parent 818f49a commit 9d836df
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions grammar/Corrections/theyre_be.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ def do(self, cur):
# Removed: Be {there day} and night
# Removed: "they're be" is full of improper usage
"""
# Exception 1: the difference between their/there, <, and {they're is}
# Exception 2: what {they're is}
if (self.sequence.prev_has_continuous(1) and self.sequence.prev_has(2) and
self.sequence.prev_word(1).word_lower == 'and' and
self.sequence.prev_word(2).word_lower in SET_THERETHEIR):

if self.sequence.prev_has_continuous(1):
# Exception 1: the difference between their/there, <, and {they're is}
if (self.sequence.prev_has(2) and self.sequence.prev_word(1).word_lower == 'and' and
self.sequence.prev_word(2).word_lower in SET_THERETHEIR):
return
# Exception 2: what {they're is}
if self.sequence.prev_word(1).word_lower == 'what':
return
# Exception 3b: {'they're' is} 'they are'
# Exception 3: {they're, aren't} they?
Expand Down

0 comments on commit 9d836df

Please sign in to comment.