scrapinghub / scrapinghub/dateparser
search_dates doesn't appear to respect settings
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
I am using the below code and I am getting incorrect values returned:
from dateparser.search import search_dates
content = "Agreement shall be renewed through and including December 31, 2024 (the \"Renewal Term\"); and (b) after the Renewal Term, the Agreement shall continue thereafter until either party elects to terminate the Agreement by delivering written notice of termination to the other party at least 90 days before the desired effective date of such termination"
results = search_dates(
content,
# azure_text_input_data.response.response["content"],
settings={"STRICT_PARSING": True, "REQUIRE_PARTS": ["day", "month", "year"]},
)
print(results)
My expectation is that only the date December 31, 2024 is returned, but when I run this I also get "90 days before" in the results. Is there something wrong in my code?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided search_dates example and inspect the dateparser.search.search_dates entry point, focusing on how STRICT_PARSING and REQUIRE_PARTS are applied. Done means the example returns only “December 31, 2024” while preserving the expected handling of other date expressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100