From 18d01dc1862470554744c476af836b3af612c579 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Fri, 9 Feb 2018 18:05:35 +0330 Subject: [PATCH] fix: remove dots from strings --- humandate/index.py | 3 +-- humandate/tests.py | 1 + setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/humandate/index.py b/humandate/index.py index ebf22f3..186c4ef 100644 --- a/humandate/index.py +++ b/humandate/index.py @@ -1,7 +1,6 @@ import datetime from datetime import timedelta import re -from itertools import repeat days_long = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'] days_short = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] @@ -54,7 +53,7 @@ keywords = list(multipliers.keys()) + months + months_short + years + days + day text = '12 jan 2019 at 12 will be amazing' def tokenize(string): - sym_pattern = re.compile(r'([!,@#$%^&*?\'"])') + sym_pattern = re.compile(r'([!,@#$%^&*?\'".])') string = sym_pattern.sub(lambda x: ' {} '.format(x.group()), string) for ts in transformations: diff --git a/humandate/tests.py b/humandate/tests.py index 8b82805..a6f5c25 100644 --- a/humandate/tests.py +++ b/humandate/tests.py @@ -56,6 +56,7 @@ class HumanDateTests(unittest.TestCase): 'jan 12': (12, 1), 'february 28': (28, 2), 'december 1th': (1, 12), + 'Feb. 28': (28, 2), } for (k, (day, m)) in tests.items(): diff --git a/setup.py b/setup.py index 474a19b..99eb00f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name = 'humandate', packages = ['humandate'], - version = '0.6', + version = '0.7', description = 'Parse human-readable dates', author = 'Mahdi Dibaiee', author_email = 'mdibaiee@aol.com',