1 # Input format (https://emojibase.dev/) is:
2 #
3 # [
4 # {
5 # "label": "greedy skull farmer",
6 # "hexcode": "000000",
7 # "emoji": "X",
8 # "text": "",
9 # "type": 1,
10 # "version": 0
11 # "tags": ["greed","skull","farming",...]
12 # ...
13 # },
14 # ...
15 # ]
16 #
17 # This script removes many Emoji based on a variety of criteria:
18 #
19 # * Partial matching label names
20 # * Groups
21 # * Unicode versions
22 #
23 # Customize to your needs.
24
25 # =============================================================================
26 # Group stuff
27 #
28 # Official group names:
29 # 0 Smileys & Emotion
30 # 1 People & Body
31 # 2 Components
32 # 3 Animals & Nature
33 # 4 Food & Drink
34 # 5 Travel & Places
35 # 6 Activities
36 # 7 Objects
37 # 8 Symbols
38 # 9 Flags
39
40
41 # Remove regional indicator letters. They're not meant to be used
42 # stand-alone and I've seen first hand that they are not widely
43 # supported as stand-alone characters (at least not yet).
44 map(select(
45 .label | test("^regional indicator") | not
46 )) |
47
48 # Previously:
49 # Put regional indicator letters with the symbols group and re-sort.
50 # Add "letter" to the tags list
51 #map(
52 # if .label | test("^regional indicator")
53 # then
54 # .group = 8 | # "Symbols"
55 # .tags += ["letter"]
56 # end
57 #) |
58 #sort_by(.group) |
59
60 # Remove "facing right" variants
61 map(select(
62 .label | test("facing right") | not
63 )) |
64
65 # Remove keycaps
66 map(select(
67 .label | test("keycap:") | not
68 )) |
69
70 # Remove families (there's so many and I've never found a use for these!)
71 map(select(
72 .label | test("family:") | not
73 )) |
74
75 # Remove genders (your tasteful joke goes here)
76 map(select(
77 .label | test("(person|(wo)?man):? ") | not
78 )) |
79
80 # Remove Japanese language elements (my audience doesn't speak it)
81 map(select(
82 .label | test("^Japanese") | not
83 )) |
84
85 # Delete group 2 (Components)
86 map(select(
87 .group != 2
88 )) |
89
90 # Delete group 9 (Flags) - they're cool, but there's so many!
91 map(select(
92 .group != 9
93 )) |
94
95 # Sadly, I'm also going to remove versions greater than 13, even
96 # though it gets rid of some great emoji. My use case doesn't support
97 # yet.
98 map(select(
99 .version <= 13
100 )) |
101
102 # There's only 49 unique uppercase words, so I don't think
103 # this is worth the loss of readability for data savings.
104 #
105 # Downcase labels
106 #map(
107 # .label |= ascii_downcase
108 #) |
109 #
110 # Downcase (and de-dupe) tags
111 #map(
112 # .tags |= (map(ascii_downcase) | unique)
113 #) |
114
115 map({label, emoji, group, tags})