scrapinghub / scrapinghub/dateparser

Word "do" is parsed as "tomorrow"

Open
#567 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

Command

from dateparser import search as se
print(dateparser.parse("today"))
print(se.search_dates("Do I have anything on the next month?", settings={"PREFER_DATES_FROM" : "future"}))

Current result

2019-09-14 20:09:17.088302
[('Do', datetime.datetime(2019, 9, 15, 0, 0))]

Expected result

2019-09-14 20:09:17.088302
None

To be honest, it would be nice if next month could be parsed by getting the current month and adding 1...buuuuut the main reason of the issue is that the word "Do" is being interpreted for some reason

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Python example with dateparser.parse and search.search_dates, focusing on why the standalone word "Do" is matched as a date. Check the parser's date-token matching and related tests; done means the sentence returns no match for "Do" while existing date parsing remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.