New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLDR script update #487
base: master
Are you sure you want to change the base?
CLDR script update #487
Conversation
Codecov Report
@@ Coverage Diff @@
## master #487 +/- ##
=======================================
Coverage 95.21% 95.21%
=======================================
Files 302 302
Lines 2506 2506
=======================================
Hits 2386 2386
Misses 120 120 Continue to review full report at Codecov.
|
@asadurski What else is missing here? The pull request description mentions updating the documentation, what needs to be updated there? |
@@ -38,16 +43,15 @@ def _modify_relative_data(relative_data): | |||
string = RELATIVE_PATTERN.sub(r'(\\d+)', string) | |||
value[i] = string | |||
modified_relative_data[key] = value | |||
return modified_relative_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is not going to return the modified_relative_data
dict we don't even need to create it because we don't need to track it.
suggestion: deleting modified_relative_data = OrderedDict()
and modified_relative_data[key] = value
.
if not primary_dict: | ||
return supplementary_dict | ||
elif not supplementary_dict: | ||
return primary_dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not primary_dict: | |
return supplementary_dict | |
elif not supplementary_dict: | |
return primary_dict | |
if not primary_dict or not supplementary_dict: | |
return primary_dict or supplementary_dict |
this is simpler, but I'm not sure about the readability of my code 🤔
Hi @asadurski ! 😄 I think we could merge it as-is and merge the new CLDR data in a different PR. I'm editing the same file here to support testing it: #663 What docs would you update? If you don't have time just let me know and we take this PR. |
@@ -17,18 +19,20 @@ | |||
numeral_translation_directory = '../dateparser/data/numeral_translation_data/' | |||
|
|||
os.chdir(os.path.dirname(os.path.abspath(__file__))) | |||
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s') | |||
log = logging.getLogger('data_scripts') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you add the log here?
TODO: documentation update must follow.