Skip to content

Commit

Permalink
Make question parsing case insensitive
Browse files Browse the repository at this point in the history
Parsing would fail on "Where is the Empire State Building" but
work on "where is the Empire State Building".
  • Loading branch information
penrods committed Mar 5, 2019
1 parent 1bbc5cb commit cd96812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def __init__(self):
re.compile(
r".*(?P<QuestionWord>who|what|when|where|why|which|whose) "
r"(?P<Query1>.*) (?P<QuestionVerb>is|are|was|were) "
r"(?P<Query2>.*)"),
r"(?P<Query2>.*)", re.IGNORECASE),
# Match:
# how X Y, e.g. "how do crickets chirp"
re.compile(
r".*(?P<QuestionWord>who|what|when|where|why|which|how) "
r"(?P<QuestionVerb>\w+) (?P<Query>.*)")
r"(?P<QuestionVerb>\w+) (?P<Query>.*)", re.IGNORECASE)
]

def _normalize(self, groupdict):
Expand Down

0 comments on commit cd96812

Please sign in to comment.