fix: remove dots from strings
This commit is contained in:
parent
4abc7d4034
commit
18d01dc186
@ -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:
|
||||
|
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user