Permalink
Browse files

fix "ass" being interpreted as a time; fix time-sensitive spec

  • Loading branch information...
jon klein
jon klein committed Aug 11, 2016
1 parent 91d122d commit e45c646a538c11053841bdaf2d434aefc7618ca6
Showing with 3 additions and 2 deletions.
  1. +1 −1 parsedatetime/__init__.py
  2. +1 −1 tests/TestComplexDateTimes.py
  3. +1 −0 tests/TestNlp.py
@@ -2547,7 +2547,7 @@ def _buildOffsets(offsetDict, localeData, indexStart):
self.RE_QUNITS = r'''\b(?P<qty>
-?
(?:\d+(?:{decimal_mark}\d+|)|(?:{numbers})s)\s?
(?:\d+(?:{decimal_mark}\d+|)|(?:{numbers})\s)\s?
(?P<qunits>{qunits})
)\b'''.format(**self.locale.re_values)
@@ -139,7 +139,7 @@ def testDates(self):
self.assertExpectedResult(
self.cal.parse('August 5th 12:00 pm', start), (target, 3))
if self.mth > 8 or (self.mth == 8 and self.dy > 5):
if self.mth > 8 or (self.mth == 8 and self.dy > 22):
target = datetime(
self.yr + 1, 8, 22, 3, 26, 0).timetuple()
else:
@@ -127,3 +127,4 @@ def testFalsePositives(self):
"happen every week!!", start), None)
self.assertExpectedResult(self.cal.nlp("$300", start), None)
self.assertExpectedResult(self.cal.nlp("300ml", start), None)
self.assertExpectedResult(self.cal.nlp("nice ass", start), None)

0 comments on commit e45c646

Please sign in to comment.