scrapinghub / scrapinghub/dateparser

Search date fails with different separator

Open
#771 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Other than the separator, both of which seem pretty common, these two results are significantly different:

In [36]: search_dates("1973.02.16")                                                                                                                                                                          
Out[36]: [('1973', datetime.datetime(1973, 8, 22, 0, 0))]

In [37]: search_dates("1973-02-16")                                                                                                                                                                          
Out[37]: [('1973-02-16', datetime.datetime(1973, 2, 16, 0, 0))]

More interesting failure cases, seems like any valid word boundary should trigger the parsing operation:

In [69]: search_dates("birthday: 2020-07-08")                                                                                                                                                                                                                                                                         
Out[69]: [('2020-07-08', datetime.datetime(2020, 7, 8, 0, 0))]

In [70]: search_dates("birthday:2020-07-08")                                                                                                                                                                                                                                                                          

In [71]:   

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 reported examples through the search_dates entry point, comparing dotted and hyphenated dates and the boundary after “birthday:”. Trace how search_dates identifies date spans and parses separators. Done means valid dates are consistently detected and parsed when adjacent to a valid word boundary, with regression coverage for the examples.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.