scrapinghub / scrapinghub/dateparser
logging the parsing process
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Hi,
Some context what I am trying to achieve, I am looking into gene symbols that could be recognized as dates. So I am trying to parse every gene symbol with every locale.
For instance gene name A2M can be parsed as a date in Spanish. Is there a way to show why is it getting parsed?
Thanks,
B
Some examples below:
>>> DateDataParser(languages=['es']).get_date_data('A2').date_obj.strftime('%A %B %X %x')
'Wednesday November 00:00:00 11/02/22'
>>> DateDataParser(languages=['es']).get_date_data('2M').date_obj.strftime('%A %B %X %x')
'Wednesday September 14:44:44 09/28/22'
>>> DateDataParser(languages=['es']).get_date_data('A2M').date_obj.strftime('%A %B %X %x')
'Wednesday September 14:44:34 09/28/22'
# This doesn't parse
>>> DateDataParser(languages=['es'], settings={'STRICT_PARSING':True}).get_date_data('A2').date_obj.strftime('%A %B %X %x')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'strftime'
>>> DateDataParser(languages=['es'], settings={'STRICT_PARSING':True}).get_date_data('2M').date_obj.strftime('%A %B %X %x')
'Wednesday September 14:43:57 09/28/22'
>>> DateDataParser(languages=['es'], settings={'STRICT_PARSING':True}).get_date_data('A2M').date_obj.strftime('%A %B %X %x')
'Wednesday September 14:44:14 09/28/22'
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 tracing DateDataParser.get_date_data() using the examples in the issue, comparing normal and STRICT_PARSING behavior. Determine where parsing decisions are made and what information should be exposed so users can understand why a gene symbol was interpreted as a date; done means the parsing process can be inspected without changing the resulting dates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100