Skip to content

Commit

Permalink
Merge pull request #85 from hugovk/update-emojilib
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Mar 15, 2022
2 parents d65a1a0 + 890fdbb commit 4d04b8b
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 9 deletions.
198 changes: 198 additions & 0 deletions em/emoji-en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -12487,5 +12487,203 @@
"🧔‍♀️": [
"woman beard",
"facial hair"
],
"🫠": [
"melting face",
"hot",
"heat"
],
"🫢": [
"face with open eyes and hand over mouth",
"silence",
"secret",
"shock",
"surprise"
],
"🫣": [
"face with peeking eye",
"scared",
"frightening",
"embarrassing"
],
"🫡": [
"saluting face",
"respect",
"salute"
],
"🫥": [
"dotted line face",
"invisible",
"lonely",
"isolation",
"depression"
],
"🫤": [
"face with diagonal mouth",
"skeptic",
"confuse",
"frustrated",
"indifferent"
],
"🥹": [
"face holding back tears",
"touched",
"gratitude"
],
"🫱": [
"rightwards hand",
"palm",
"offer"
],
"🫲": [
"leftwards hand",
"palm",
"offer"
],
"🫳": [
"palm down hand",
"palm",
"drop"
],
"🫴": [
"palm up hand",
"lift",
"offer",
"demand"
],
"🫰": [
"hand with index finger and thumb crossed",
"heart",
"love",
"money",
"expensive"
],
"🫵": [
"index pointing at the viewer",
"you",
"recruit"
],
"🫶": [
"heart hands",
"love",
"appreciation",
"support"
],
"🫦": [
"biting lip",
"flirt",
"sexy",
"pain",
"worry"
],
"🫅": [
"person with crown",
"royalty",
"power"
],
"🫃": [
"pregnant man",
"baby",
"belly"
],
"🫄": [
"pregnant person",
"baby",
"belly"
],
"🧌": [
"troll",
"mystical",
"monster"
],
"🪸": [
"coral",
"ocean",
"sea",
"reef"
],
"🪷": [
"lotus",
"flower",
"calm",
"meditation"
],
"🪹": [
"empty nest",
"bird"
],
"🪺": [
"nest with eggs",
"bird"
],
"🫘": [
"beans",
"food"
],
"🫗": [
"pouring liquid",
"cup",
"water"
],
"🫙": [
"jar",
"container",
"sauce"
],
"🛝": [
"playground slide",
"fun",
"park"
],
"🛞": [
"wheel",
"car",
"transport"
],
"🛟": [
"ring buoy",
"life saver",
"life preserver"
],
"🪬": [
"hamsa",
"religion",
"protection"
],
"🪩": [
"mirror ball",
"disco",
"dance",
"party"
],
"🪫": [
"low battery",
"drained",
"dead"
],
"🩼": [
"crutch",
"accessibility",
"assist"
],
"🩻": [
"x-ray",
"skeleton",
"medicine"
],
"🫧": [
"bubbles",
"soap",
"fun",
"carbonation",
"sparkling"
],
"🪪": [
"identification card",
"document"
],
"🟰": [
"heavy equals sign",
"math"
]
}
2 changes: 1 addition & 1 deletion em/emojis.json

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions scripts/despacify.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
"""
Replace spaces in emoji keywords with underscores
"""
from __future__ import annotations

import json
import os

from em import EMOJI_PATH, parse_emojis
from em import parse_emojis

# The unprocessed source file
INPUT_EMOJILIB_PATH = os.path.join(os.path.dirname(EMOJI_PATH), "emoji-en-US.json")
INPUT_EMOJILIB_PATH = "em/emoji-en-US.json"
OUTPUT_EMOJI_PATH = "em/emojis.json"


def save_emojis(data, filename):
def save_emojis(data: dict[str, list[str]], filename: str) -> None:
with open(filename, "w") as outfile:
json.dump(data, outfile, indent=None, separators=(",", ":"))


def main():
def main() -> None:
data = parse_emojis(INPUT_EMOJILIB_PATH)
for emoji, keywords in data.items():
keywords = [keyword.replace(" ", "_") for keyword in keywords]
data[emoji] = keywords
save_emojis(data, EMOJI_PATH)
print(f"Emojis saved to {EMOJI_PATH}")
save_emojis(data, OUTPUT_EMOJI_PATH)
print(f"Emojis saved to {OUTPUT_EMOJI_PATH}")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions scripts/update-emojilib.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
wget https://github.com/muan/emojilib/raw/main/dist/emoji-en-US.json -O ./em/emoji-en-US.json
python3 scripts/despacify.py

0 comments on commit 4d04b8b

Please sign in to comment.