Skip to content

Conversation

@christianfm10
Copy link
Contributor

@christianfm10 christianfm10 commented Jan 4, 2019

I've added 'mediodía' and 'medianoche' spanish words and a test for both cases
This fixes #472
Before this feature:

>>> import dateparser
>>> dateparser.parse('mediodía') #This is noon in Spanish.
>>> dateparser.parse('medianoche') #This is midnight in Spanish.

After this feature:

>>> import dateparser
>>> dateparser.parse('mediodía') #This is noon in Spanish.
datetime.datetime(2019, 1, 11, 12, 0)
>>> dateparser.parse('medianoche') #This is midnight in Spanish.
datetime.datetime(2019, 1, 11, 0, 0)

@codecov
Copy link

codecov bot commented Jan 4, 2019

Codecov Report

Merging #476 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #476      +/-   ##
==========================================
+ Coverage   94.99%   94.99%   +<.01%     
==========================================
  Files         302      302              
  Lines        2457     2459       +2     
==========================================
+ Hits         2334     2336       +2     
  Misses        123      123
Impacted Files Coverage Δ
dateparser/data/date_translation_data/es.py 100% <ø> (ø) ⬆️
dateparser/timezone_parser.py 97.91% <0%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66d5470...743ec81. Read the comment docs.

Copy link
Contributor

@eLRuLL eLRuLL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianfm10 please share some scripts with usage from before and after these new feature, with some examples on what kind of phrases this could be helpful. Thanks.

},
{
"(?:12\\s+)?medianoche": "00:00"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianfm10 please add a trailing comma here and also an extra newline at the end of the file. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file shouldn't be edited directly, instead he should run the write_complete_data.py script that generates the json file from the .yaml file.

@Gallaecio
Copy link
Member

@christianfm10 Do you plan to continue working on this? Otherwise, would you mind if I take over? I see this only needs dealing with @eLRuLL’s feedback, maybe adding “la” to the list of words (since there is “el”), and adding tests that cover the use of those words to be ignored.

@noviluni noviluni added the language language related issue/PR label Apr 30, 2020
},
{
"(?:12\\s+)?medianoche": "00:00"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file shouldn't be edited directly, instead he should run the write_complete_data.py script that generates the json file from the .yaml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

language language related issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "mediodía" and "medianoche" Spanish words.

4 participants