-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Tools: add a script to download Unicode data files, and rename grapheme_break_property_data_gen.py to unicode_properties_data_gen.py
#4435
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
Changes from all commits
13db7c9
d11ad04
0b73e36
d4dee1a
211febf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| from urllib.request import urlretrieve | ||
|
|
||
|
|
||
| Unicode_data_files = { | ||
| "DerivedCoreProperties.txt": "https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt", | ||
| "DerivedGeneralCategory.txt": "https://www.unicode.org/Public/UCD/latest/ucd/extracted/DerivedGeneralCategory.txt", | ||
| "EastAsianWidth.txt": "https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt", | ||
| "GraphemeBreakProperty.txt": "https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt", | ||
| "GraphemeBreakTest.txt": "https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt", | ||
| "emoji-data.txt": "https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt", | ||
| } | ||
|
Comment on lines
+7
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it desirable that these pull data from the latest available UCD files? That complicates rerunning the scripts with the intention to match what might have been downloaded previously. If it is intentional, perhaps rename the script to |
||
|
|
||
| def download_unicode_data_files(): | ||
| for filename, url in Unicode_data_files.items(): | ||
| print(f"downloading {filename} from {url}") | ||
| urlretrieve(url, filename) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| download_unicode_data_files() | ||
Uh oh!
There was an error while loading. Please reload this page.