Skip to content

Commit c4b26ea

Browse files
authored
Emoji 17.0 beta charts (#1133)
1 parent 35992e1 commit c4b26ea

File tree

6 files changed

+638
-602
lines changed

6 files changed

+638
-602
lines changed

docs/emoji/generate-emoji.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ be updated as well. In particular, they need to be added to
9292

9393
## Final Candidates
9494

95+
In many respects Final is not much different from Draft. One notable difference
96+
is that new code points lose their "X" prefix in emoji-released.html, so if you
97+
are still seeing those it is a sign that this Stage has not been reached.
98+
9599
Moving from final candidates involves a number of changes.

unicodetools/data/emoji/dev/internal/emoji-proposals.txt

Lines changed: 152 additions & 282 deletions
Large diffs are not rendered by default.

unicodetools/src/main/java/org/unicode/tools/emoji/EmojiData.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,8 +2251,10 @@ public UnicodeSet getMultiPersonGroupings() {
22512251
.put("👩‍🤝‍👩", "👭")
22522252
.put("🧑‍❤️‍💋‍🧑", "💏")
22532253
.put("🧑‍❤️‍🧑", "💑")
2254+
.put("🧑‍🐰‍🧑", "👯")
22542255
.put("👨‍🐰‍👨", "👯")
22552256
.put("👩‍🐰‍👩", "👯")
2257+
.put("🧑‍🫯‍🧑", "🤼")
22562258
.put("👨‍🫯‍👨", "🤼")
22572259
.put("👩‍🫯‍👩", "🤼")
22582260
.build();

unicodetools/src/main/java/org/unicode/tools/emoji/ProposalData.java

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.unicode.tools.emoji;
22

33
import com.google.common.base.Splitter;
4-
import com.google.common.collect.ImmutableMap;
54
import com.google.common.collect.ImmutableMultimap;
65
import com.google.common.collect.ImmutableSet;
76
import com.google.common.collect.Multimap;
@@ -173,7 +172,7 @@ public String formatProposalsForHtml(Collection<String> proposals) {
173172
static UnicodeMap<Set<String>> load(StringBuffer header) {
174173
UnicodeMap<Set<String>> builder = new UnicodeMap<>();
175174
Set<String> skinProposals = ImmutableSet.<String>builder().add("L2/14-173").build();
176-
Set<String> genProposals = ImmutableSet.<String>builder().add("L2/16160").build();
175+
Set<String> genProposals = ImmutableSet.<String>builder().add("L2/16-160").build();
177176

178177
boolean haveData = false;
179178
for (String line : FileUtilities.in(ProposalData.class, "proposalData.txt")) {
@@ -313,32 +312,27 @@ public static Set<String> cleanProposalString(String proposalString) {
313312
return ImmutableSet.copyOf(result);
314313
}
315314

316-
static final Map<String, String> SHORTEST_SKELETON =
317-
ImmutableMap.<String, String>builder()
318-
.put("🧑🏿‍❤️‍💋‍🧑🏿", "💏🏿")
319-
.put("🧑🏿‍❤️‍🧑🏿", "💑🏿")
320-
.put("👨🏿‍🐰‍👨🏿", "👯🏿")
321-
.put("👩🏿‍🐰‍👩🏿", "👯🏿")
322-
.put("🧑🏿‍🐰‍🧑🏿", "👯🏿")
323-
.put("👨🏿‍🫯‍👨🏿", "🤼🏿")
324-
.put("👩🏿‍🫯‍👩🏿", "🤼🏿")
325-
.put("🧑🏿‍🫯‍🧑🏿", "🤼🏿")
326-
.build();
327-
328-
// static {
329-
// for (Entry<String, String> entry : SHORTEST_SKELETON.entrySet()) {
330-
// System.out.println(".put(\"" + entry.getKey() + "\",\"" + entry.getValue() + "\")"
331-
// + "\t// " + Utility.hex(entry.getKey()) + " => " +
332-
// Utility.hex(entry.getValue()));
333-
// }
334-
// }
335-
336315
private static String shortestForm(String s) {
337-
String result = SHORTEST_SKELETON.get(s);
338-
if (result == null) {
339-
return s;
316+
if (EmojiData.EMOJI_DATA_BETA.isHandshake(s)) {
317+
// All handshake sequences have the same proposal.
318+
return EmojiData.HANDSHAKE_STRING;
340319
}
341-
return result;
320+
321+
// Use the existing mapping maintained by EmojiData,
322+
// adding emoji variants for sequences containing ❤️.
323+
String withoutTone = EmojiData.SKIN_SPANNER.deleteFrom(s);
324+
String standardized = EmojiData.EMOJI_DATA_BETA.addEmojiVariants(withoutTone);
325+
String couple = EmojiData.MAP_TO_COUPLES.get(standardized);
326+
if (couple != null) {
327+
if (s.indexOf(SKIN_REPRESENTATIVE) >= 0) {
328+
// The provided string has normalized skin tone(s) and
329+
// the result is a single code point, re-add the tone.
330+
couple += SKIN_REPRESENTATIVE;
331+
}
332+
return couple;
333+
}
334+
335+
return s;
342336
}
343337

344338
public static String removeEmojiVariant(String s) {

unicodetools/src/main/resources/org/unicode/tools/emoji/candidateData.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Then run ProposalData.java to generate an updated version of proposalData.txt that incorporates all the proposal data from this file.
1515

1616
#================================
17-
Status=Draft Candidate
17+
Status=Final Candidate
1818
#================================
1919

2020
Proposal=L2/24-250

0 commit comments

Comments
 (0)