scrapinghub / scrapinghub/dateparser

Written Number Parsing Not as Expected

Open
#1,236 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Based on the description of the library and the various examples, I had assumed English spelling of words such as "twenty", "thirty", "forty", etc. would be properly parsed by this library. Upon investigating the code, it seems that for English, this library only parses the spelled out numbers 1-12: https://github.com/scrapinghub/dateparser/blob/master/dateparser/data/date_translation_data/en.py#L789 which honestly was a surprise. Is there any way to support parsing something like "in twenty minutes"? Would you guys be open to a PR adding this extra support?

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 with the English translation data in dateparser/data/date_translation_data/en.py, particularly the referenced section around line 789, and trace how written numbers are used during parsing. The work is done when phrases such as "in twenty minutes" are supported consistently with the library's documented examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
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.