Merge pull request #2735 from thelounge/xpaw/fix-emoji-gen

Update emoji data for Emoji v11
This commit is contained in:
Jérémie Astori 2018-08-31 23:59:12 -04:00 committed by GitHub
commit 8c06bd3a75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3756 additions and 3513 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ const fs = require("fs");
const fuzzy = require("fuzzy"); const fuzzy = require("fuzzy");
request.get({ request.get({
url: "https://raw.githubusercontent.com/emojione/emojione/master/emoji_strategy.json", url: "https://raw.githubusercontent.com/emojione/emojione/master/extras/alpha-codes/eac.json",
json: true, json: true,
}, (error, response, emojiStrategy) => { }, (error, response, emojiStrategy) => {
const emojiMap = {}; const emojiMap = {};
@ -14,8 +14,8 @@ request.get({
for (const key in emojiStrategy) { for (const key in emojiStrategy) {
if (emojiStrategy.hasOwnProperty(key)) { if (emojiStrategy.hasOwnProperty(key)) {
const shortname = prepareShortName(emojiStrategy[key].shortname); const shortname = prepareShortName(emojiStrategy[key].alpha_code);
const unicode = stringToUnicode(emojiStrategy[key].unicode_output); const unicode = stringToUnicode(emojiStrategy[key].output);
fullNameEmojiMap[unicode] = emojiStrategy[key].name; fullNameEmojiMap[unicode] = emojiStrategy[key].name;
// Skip tones, at least for now // Skip tones, at least for now
@ -25,7 +25,7 @@ request.get({
emojiMap[shortname] = unicode; emojiMap[shortname] = unicode;
for (let alternative of emojiStrategy[key].shortname_alternates) { for (let alternative of emojiStrategy[key].aliases.split("|")) {
alternative = prepareShortName(alternative); alternative = prepareShortName(alternative);
if (fuzzy.test(shortname, alternative) || fuzzy.test(alternative, shortname)) { if (fuzzy.test(shortname, alternative) || fuzzy.test(alternative, shortname)) {