From 405c290f73cdc81cb544bc4fff4feb8b03121b52 Mon Sep 17 00:00:00 2001 From: wkyoshida Date: Wed, 9 Nov 2022 00:55:53 -0300 Subject: [PATCH] #14 save tmp emoji files for testing --- .gitignore | 5 +++++ src/scribe_data/extract_transform/process_unicode.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index da7a8ce44..a0596a63c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,8 @@ __pycache__ ########### node_modules package-lock.json + +# Temporary to test +# TODO remove later +################### +tmp_*.json diff --git a/src/scribe_data/extract_transform/process_unicode.py b/src/scribe_data/extract_transform/process_unicode.py index 27fab76b1..59d2436db 100644 --- a/src/scribe_data/extract_transform/process_unicode.py +++ b/src/scribe_data/extract_transform/process_unicode.py @@ -74,6 +74,13 @@ def gen_emoji_autosuggestions( print("Number of trigger keywords found:", len(autosuggest_dict)) + output_path = f"tmp_{iso}_emojisuggestions.json" + + with open(output_path, "w", encoding="utf-8") as file: + json.dump(autosuggest_dict, file, ensure_ascii=False, indent=0) + + print(f"Emoji autosuggestions for '{language}' generated and saved to '{output_path}'.") + ### return autosuggest_dict