From 1bea64da068c18993d4f4d852a26cdcb2d7f1ba2 Mon Sep 17 00:00:00 2001 From: Adnan Awan Date: Tue, 30 Jan 2024 12:53:12 +0500 Subject: [PATCH] [dateparser] Fix parsing very short weekday names - Update en.yaml file to support two letters days of the week - https://github.com/scrapinghub/dateparser/issues/1170 --- dateparser/data/date_translation_data/en.py | 19 +++++++++++------ .../date_translation_data/en.yaml | 21 +++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/dateparser/data/date_translation_data/en.py b/dateparser/data/date_translation_data/en.py index b70975e1b..74fd0c66f 100644 --- a/dateparser/data/date_translation_data/en.py +++ b/dateparser/data/date_translation_data/en.py @@ -51,32 +51,39 @@ ], "monday": [ "mon", - "monday" + "monday", + "mo" ], "tuesday": [ "tue", "tuesday", + "tu", "Tues" ], "wednesday": [ "wed", - "wednesday" + "wednesday", + "we" ], "thursday": [ "thu", - "thursday" + "thursday", + "th" ], "friday": [ "fri", - "friday" + "friday", + "fr" ], "saturday": [ "sat", - "saturday" + "saturday", + "sa" ], "sunday": [ "sun", - "sunday" + "sunday", + "su" ], "am": [ "am" diff --git a/dateparser_data/supplementary_language_data/date_translation_data/en.yaml b/dateparser_data/supplementary_language_data/date_translation_data/en.yaml index d103bc577..172961545 100644 --- a/dateparser_data/supplementary_language_data/date_translation_data/en.yaml +++ b/dateparser_data/supplementary_language_data/date_translation_data/en.yaml @@ -3,9 +3,30 @@ pertain: ["of"] sentence_splitter_group : 1 +# two letters days of week + +monday: + - mo + tuesday: + - tu - Tues +wednesday: + - we + +thursday: + - th + +friday: + - fr + +saturday: + - sa + +sunday: + - su + september: - sept