Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dateparser/data/date_translation_data/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@
"and",
"at",
"by",
"from",
"just",
"m",
"nd",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
skip: ["about", "ad", "and", "at", "by", "just", "m", "nd", "of", "on", "rd", "st", "th", "the"]
skip: ["about", "ad", "and", "at", "by", "from", "just", "m", "nd", "of", "on", "rd", "st", "th", "the"]
pertain: ["of"]

sentence_splitter_group : 1
Expand Down
16 changes: 16 additions & 0 deletions tests/test_freshness_date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,6 +1814,22 @@ def test_normalized_relative_dates(self, date_string, ago, period):
param("3 hours later", in_future={"hours": 3}, period="day"),
param("4 minutes later", in_future={"minutes": 4}, period="day"),
param("5 seconds later", in_future={"seconds": 5}, period="day"),
# from now
param("7 years from now", in_future={"years": 7}, period="year"),
param("6 months from now", in_future={"months": 6}, period="month"),
param("5 weeks from now", in_future={"weeks": 5}, period="week"),
param("4 days from now", in_future={"days": 4}, period="day"),
param("3 hours from now", in_future={"hours": 3}, period="day"),
param("2 minutes from now", in_future={"minutes": 2}, period="day"),
param("1 second from now", in_future={"seconds": 1}, period="day"),
param("five years from now", in_future={"years": 5}, period="year"),
param("a year from now", in_future={"years": 1}, period="year"),
param("an hour from now", in_future={"hours": 1}, period="day"),
param(
"1 year 2 months from now",
in_future={"years": 1, "months": 2},
period="month",
),
# Fractional units
param("in 2.5 hours", in_future={"hours": 2.5}, period="day"),
param("in 10.75 minutes", in_future={"minutes": 10.75}, period="day"),
Expand Down
Loading