Merge pull request #2335 from ChanceNCounter/bug/day-after-tomorrow
Fixes index error in parse_en.extract_datetime()pull/2292/head
commit
87a7821926
|
@ -828,7 +828,7 @@ def extract_datetime_en(string, dateNow, default_time):
|
||||||
wordNext == "after" and
|
wordNext == "after" and
|
||||||
wordNextNext == "tomorrow" and
|
wordNextNext == "tomorrow" and
|
||||||
not fromFlag and
|
not fromFlag and
|
||||||
not wordPrev[0].isdigit()):
|
not (wordPrev[0].isdigit() if wordPrev else False)):
|
||||||
dayOffset = 2
|
dayOffset = 2
|
||||||
used = 3
|
used = 3
|
||||||
if wordPrev == "the":
|
if wordPrev == "the":
|
||||||
|
|
|
@ -254,6 +254,8 @@ class TestNormalize(unittest.TestCase):
|
||||||
"2017-07-02 00:00:00", "set ambush")
|
"2017-07-02 00:00:00", "set ambush")
|
||||||
testExtract("What is the day after tomorrow's weather?",
|
testExtract("What is the day after tomorrow's weather?",
|
||||||
"2017-06-29 00:00:00", "what is weather")
|
"2017-06-29 00:00:00", "what is weather")
|
||||||
|
testExtract("day after tomorrow",
|
||||||
|
"2017-06-29 00:00:00", "")
|
||||||
testExtract("Remind me at 10:45 pm",
|
testExtract("Remind me at 10:45 pm",
|
||||||
"2017-06-27 22:45:00", "remind me")
|
"2017-06-27 22:45:00", "remind me")
|
||||||
testExtract("what is the weather on friday morning",
|
testExtract("what is the weather on friday morning",
|
||||||
|
|
Loading…
Reference in New Issue