Skip to content

Commit

Permalink
scribe-org#14 cldr package downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
wkyoshida committed Nov 6, 2022
1 parent b8f7c19 commit de95845
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ dist
*.egg-info
# Caches
__pycache__

# NPM files
###########
node_modules
package-lock.json
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"cldr-annotations-derived-full": "latest"
}
}
19 changes: 18 additions & 1 deletion src/scribe_data/extract_transform/process_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
gen_emoji_autosuggestions
"""

import json

from scribe_data.load.update_utils import get_language_iso

def gen_emoji_autosuggestions(
language="English",
num_emojis=500,
Expand Down Expand Up @@ -42,6 +46,19 @@ def gen_emoji_autosuggestions(

autosuggest_dict = {}

# TODO
### TODO further updates - here for data loading illustration

language = get_language_iso(language)

cldr_file_path = f'node_modules/cldr-annotations-derived-full/annotationsDerived/{language}/annotations.json'

with open(cldr_file_path, 'r') as file:
cldr_data = json.load(file)

emoji_dict = cldr_data['annotationsDerived']['annotations']

print("Number of emojis loaded:", len(emoji_dict))

###

return autosuggest_dict
20 changes: 20 additions & 0 deletions src/scribe_data/load/gen_emoji_suggestions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@
"pwd = pwd.split(\"scribe_data\")[0]\n",
"sys.path.append(pwd)"
]
},
{
"cell_type": "markdown",
"id": "2add942e",
"metadata": {},
"source": [
"# Download Latest Unicode"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8e166da1",
"metadata": {},
"outputs": [],
"source": [
"%%bash\n",
". $HOME/.nvm/nvm.sh # Pick up the 'npm' command\n",
"npm install"
]
}
],
"metadata": {
Expand Down

0 comments on commit de95845

Please sign in to comment.