scrapinghub / dateparser

python parser for human readable dates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

word with dots breaks date parsing in french

JulienMaille opened this issue · comments

I'm trying to parse french text and noticed that words with dots preceding the date will break the parser

print(search_dates("TAS le 10/01", settings={'DATE_ORDER': 'DMY'}))   #[('le 10/01', datetime.datetime(2024, 1, 10, 0, 0))]
print(search_dates("T.A.S le 10/01", settings={'DATE_ORDER': 'DMY'})) #None

Changing le for on does fix it though

print(search_dates("TAS on 10/01", settings={'DATE_ORDER': 'DMY'}))   #[('on 10/01', datetime.datetime(2024, 1, 10, 0, 0))]
print(search_dates("T.A.S on 10/01", settings={'DATE_ORDER': 'DMY'})) #[('on 10/01', datetime.datetime(2024, 1, 10, 0, 0))]

Is there anything I can do with the settings to fix that?
Thanks a lot