Skip to content

Commit

Permalink
maybe verbed nouns
Browse files Browse the repository at this point in the history
  • Loading branch information
notwaldorf committed Oct 5, 2016
1 parent a910c44 commit 7fb8331
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions emoji-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,21 @@ function getMeAnEmoji(word) {
// Don't do this for single letter since that will pluralize crazy things.
var maybePlural = (word.length == 1) ? '' : word + 's';

var maybeVerbed = (word.indexOf('ing') == -1) ? '' : word.substr(0, word.length-3);

// Go through all the things and find the first one that matches.
var useful = [];

// Go through all the things and find the first one that matches.
for (var emoji in allEmojis) {
var words = allEmojis[emoji].keywords;
if (word == allEmojis[emoji].char ||
emoji == word || (emoji == word + '_face' ) ||
emoji == maybeSingular || emoji == maybePlural ||
emoji == word || (emoji == word + '_face' ) ||
emoji == maybeSingular || emoji == maybePlural || emoji == maybeVerbed ||
(words && words.indexOf(word) >= 0) ||
(words && words.indexOf(maybeSingular) >= 0) ||
(words && words.indexOf(maybePlural) >= 0)) {
(words && words.indexOf(maybePlural) >= 0) ||
(words && words.indexOf(maybeVerbed) >= 0)) {
useful.push(allEmojis[emoji].char);
}
}
Expand Down

0 comments on commit 7fb8331

Please sign in to comment.