scrapinghub / scrapinghub/dateparser
search_dates cannot find complete date
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
This simple example
text = 'Il giorno martedì 23 aprile 2019'
for chunk, date in search_dates(text, languages=['it'], settings={'DATE_ORDER': 'DMY'}):
print(chunk)
prints three separate chunks:
martedì
aprile
2019
none of which is a complete date. For some reason it fails to recognize martedì 23 aprile 2019 as a single chunk. Removing Il giorno (the day) from the beginning of the sentence makes it parse correctly for some reason
Running on Mac OSX with
bash-3.2$ LOCALE
LANG="it_IT.UTF-8"
LC_COLLATE="it_IT.UTF-8"
LC_CTYPE="it_IT.UTF-8"
LC_MESSAGES="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_ALL=
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 reproducing the shown search_dates call with the Italian text and DATE_ORDER set to DMY. Trace the date-language parsing path responsible for combining the weekday, day, month, and year; done means the complete phrase is returned as one date chunk without breaking the existing example.
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
- 48/100