Skip to content

Commit

Permalink
Add more emoji
Browse files Browse the repository at this point in the history
...and fix sorting in support table.
  • Loading branch information
wooorm committed Mar 30, 2017
1 parent 63462a6 commit d4df430
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 27 deletions.
65 changes: 63 additions & 2 deletions faces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
%%%%% [2]: For information regarding the names emoji's
%%%%% often go by: http://emojipedia.org/people/
%%%%%
%%%%% [3]: http://emojipedia.org/
%%%%%

% `smile` receives an AFINN score of `2`.
smile: 2
Expand Down Expand Up @@ -65,7 +67,9 @@ flushed: -2
% kept this mistake in place[2].
% Therefore, this emoji is classified as a slightly
% negative `-1`.
grin: -1
% EDIT: Apple has fixed this, and others' have too[3],
% so I’m reclassifying as `2`.
grin: 2

% `pensive` receives an AFINN score of `-1`.
pensive: -1
Expand Down Expand Up @@ -140,7 +144,7 @@ rage: -4

% `triumph` receives an AFINN score of `4`. However,
% it can be seen as angry and is sometimes just
% called 'face with stream from nose', so it
% called 'face with stream from nose', so it
% is given an average of `0`
triumph: 0

Expand Down Expand Up @@ -220,6 +224,63 @@ smirk: 2
% No emotion, thus `0`.
expressionless: 0

% Basically like `joy`, but even more enthusiastically.
rofl: 4

% `slightly_smiling_face`, a little less happy than `smile`.
slightly_smiling_face: 1

% `upside_down_face`: I have no clue... Sure it’s smiling... But...
upside_down_face: 0

% `money_mouth_face`: ???
money_mouth_face: 0

% `hugs` receives an AFINN score of `2`.
hugs: 2

% thesaurus.com gives `fool`, `weirdo` as synonyms, which both have an AFINN
% rating of `-2`. However, this looks quite happy & cute, so I’ll be less
% harsh.
nerd_face: -1

% Quite scary to some people (`fool: -2`), ok for others (comedy, comic: 1),
% so I’ll keep it at `0` (neutral).
clown_face: 0

% Funky, this doesn’t indicate any valence in the Unicode spec, but all
% vendors seem to put the cowboy hat on `smiley` (which gets a `+2`).
cowboy_hat_face: 2

% As `frowning` gets a `-1` (and I’m not going to add `-0.5`), I’ll give this
% `-1` too. Sure, there’s a difference, but unless both Emoji appear next to
% each other, that difference is subtile.
slightly_frowning_face: -1

% No AFINN matches for this, but it gets confusing appearances across vendors:
% some are very positive, but some are quite fearful.
drooling_face: 0

% Quite negative & unamused, but less negative than `unamused`.
roll_eyes: -1

% Although thinking in general is positive (`engrossing: 3`, `engrossed: 1`)
% this emoji is depicted more as “doubting”, and used when something is
% “doubted” (`-1`).
thinking: -1

% Closest to “lied” (`-2`).
lying_face: -2

% Closest to `silencing` (`-1`)
zipper_mouth_face: -1

% Closest to `sick` (`-2`)
nauseated_face: -2
face_with_head_bandage: -2 % (`hurt`: `-2`)
sneezing_face: -2 % Closest to `sneezing` (`-2`)
face_with_thermometer: -1

%%%%%
%%%%% Cat faces:
%%%%%
Expand Down
92 changes: 91 additions & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"emoji": "😊",
"polarity": 2
},
{
"name": "clown_face",
"emoji": "🤡",
"polarity": 0
},
{
"name": "cold_sweat",
"emoji": "😰",
Expand All @@ -34,6 +39,11 @@
"emoji": "😕",
"polarity": -2
},
{
"name": "cowboy_hat_face",
"emoji": "🤠",
"polarity": 2
},
{
"name": "cry",
"emoji": "😢",
Expand All @@ -59,11 +69,26 @@
"emoji": "😵",
"polarity": -1
},
{
"name": "drooling_face",
"emoji": "🤤",
"polarity": 0
},
{
"name": "expressionless",
"emoji": "😑",
"polarity": 0
},
{
"name": "face_with_head_bandage",
"emoji": "🤕",
"polarity": -2
},
{
"name": "face_with_thermometer",
"emoji": "🤒",
"polarity": -1
},
{
"name": "fearful",
"emoji": "😨",
Expand All @@ -87,7 +112,7 @@
{
"name": "grin",
"emoji": "😁",
"polarity": -1
"polarity": 2
},
{
"name": "grinning",
Expand All @@ -104,6 +129,11 @@
"emoji": "😻",
"polarity": 3
},
{
"name": "hugs",
"emoji": "🤗",
"polarity": 2
},
{
"name": "hushed",
"emoji": "😯",
Expand Down Expand Up @@ -159,11 +189,31 @@
"emoji": "😆",
"polarity": 1
},
{
"name": "lying_face",
"emoji": "🤥",
"polarity": -2
},
{
"name": "mask",
"emoji": "😷",
"polarity": -1
},
{
"name": "money_mouth_face",
"emoji": "🤑",
"polarity": 0
},
{
"name": "nauseated_face",
"emoji": "🤢",
"polarity": -2
},
{
"name": "nerd_face",
"emoji": "🤓",
"polarity": -1
},
{
"name": "neutral_face",
"emoji": "😐",
Expand Down Expand Up @@ -209,6 +259,16 @@
"emoji": "😌",
"polarity": 2
},
{
"name": "rofl",
"emoji": "🤣",
"polarity": 4
},
{
"name": "roll_eyes",
"emoji": "🙄",
"polarity": -1
},
{
"name": "scream",
"emoji": "😱",
Expand All @@ -229,6 +289,16 @@
"emoji": "😪",
"polarity": 0
},
{
"name": "slightly_frowning_face",
"emoji": "🙁",
"polarity": -1
},
{
"name": "slightly_smiling_face",
"emoji": "🙂",
"polarity": 1
},
{
"name": "smile",
"emoji": "😄",
Expand Down Expand Up @@ -264,6 +334,11 @@
"emoji": "😼",
"polarity": 2
},
{
"name": "sneezing_face",
"emoji": "🤧",
"polarity": -2
},
{
"name": "sob",
"emoji": "😭",
Expand Down Expand Up @@ -299,6 +374,11 @@
"emoji": "😅",
"polarity": 2
},
{
"name": "thinking",
"emoji": "🤔",
"polarity": -1
},
{
"name": "tired_face",
"emoji": "😫",
Expand All @@ -314,6 +394,11 @@
"emoji": "😒",
"polarity": -2
},
{
"name": "upside_down_face",
"emoji": "🙃",
"polarity": 0
},
{
"name": "weary",
"emoji": "😩",
Expand All @@ -333,5 +418,10 @@
"name": "yum",
"emoji": "😋",
"polarity": 3
},
{
"name": "zipper_mouth_face",
"emoji": "🤐",
"polarity": -1
}
]
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"index.json"
],
"devDependencies": {
"alphanum-sort": "^1.0.2",
"browserify": "^14.0.0",
"esmangle": "^1.0.0",
"gemoji": "^4.0.0",
Expand Down Expand Up @@ -57,6 +58,8 @@
]
},
"remarkConfig": {
"plugins": ["preset-wooorm"]
"plugins": [
"preset-wooorm"
]
}
}
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
List of emoji rated for valence with an integer between minus five
(negative) and plus five (positive).

This list does not contain emoji modifiers (skin-tones). Use something like
[`strip-skin-tone`][strip-skin-tone] to remove them if you’d like.

## Installation

[npm][]:
Expand Down Expand Up @@ -74,3 +77,5 @@ may or may not be available on the users computer.
[unicode]: http://www.unicode.org/Public/emoji/1.0/full-emoji-list.html

[afinn-111]: https://github.com/wooorm/afinn-111

[strip-skin-tone]: https://github.com/wooorm/strip-skin-tone
16 changes: 13 additions & 3 deletions script/build-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
/* Dependencies. */
var fs = require('fs');
var path = require('path');
var gemoji = require('gemoji');
var gemoji = require('gemoji').name;
var toJSON = require('plain-text-data-to-json');

/* Read. */
var faces = toJSON(fs.readFileSync('faces.txt', 'utf8'));

/* Manipulate. */
faces = Object.keys(faces).sort().map(function (name) {
var num = Number(faces[name]);

if (isNaN(num)) {
console.log('Invalid valence for %s: %s', name, faces[name]);
}

if (!gemoji[name]) {
console.log('Invalid gemoji %s', name);
}

return {
name: name,
emoji: gemoji.name[name].emoji,
polarity: Number(faces[name])
emoji: gemoji[name].emoji,
polarity: num
};
});

Expand Down
11 changes: 5 additions & 6 deletions script/build-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
var fs = require('fs');
var table = require('markdown-table');
var width = require('string-width');
var sort = require('alphanum-sort/lib/compare');
var gemoji = require('gemoji');
var emotion = require('..');

Expand All @@ -16,12 +17,8 @@ var data = [[
]].concat(
emotion
.sort(function (a, b) {
if (a.polarity === b.polarity) {
return gemoji.unicode[a.emoji].name.charCodeAt(0) -
gemoji.unicode[b.emoji].name.charCodeAt(0);
}

return a.polarity - b.polarity;
var diff = a.polarity - b.polarity;
return diff || sort({}, gemoji.unicode[a.emoji].name, gemoji.unicode[b.emoji].name);
})
.map(function (emotion) {
return [
Expand All @@ -36,6 +33,8 @@ var data = [[
var doc = [
'# Support',
'',
'<!--lint disable table-pipe-alignment-->',
'',
'Note that this file does not contain the gemoji’s as rendered',
'by GitHub. You need a browser capable of viewing unicode-emoji',
'to make sense of the first column!',
Expand Down
Loading

0 comments on commit d4df430

Please sign in to comment.