From 9e38b5a8bb6d1ec698b4871d74a4269c8f63232b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 15 Oct 2018 11:13:43 -0400 Subject: [PATCH] emoji: a couple of flags (it's the letters) This needs a fix to the representation of combined unicodes. Perhaps every item in the list needs to be a list of lists? or just to split the string? Signed-off-by: Vincent Batts --- emoji/emojimap.json | 4 ++-- emoji/map.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/emoji/emojimap.json b/emoji/emojimap.json index cf06d4c..7b3c8f2 100644 --- a/emoji/emojimap.json +++ b/emoji/emojimap.json @@ -240,10 +240,10 @@ [":turtle:"], [":carousel_horse:", "U+1F3A0"], [":two_women_holding_hands:", ":two_men_holding_hands:", ":couple:", "U+1F46C ", "U+1F46D", "U+1F46B"], - [":uk:"], + [":uk:", "U+1F1EC", "U+1F1E7"], [":umbrella:"], [":unlock:"], - [":us:"], + [":us:", "U+1F1FA", "U+1F1F8"], [":v:"], [":vhs:"], [":violin:"], diff --git a/emoji/map.go b/emoji/map.go index b146e6c..75edb87 100644 --- a/emoji/map.go +++ b/emoji/map.go @@ -28,7 +28,8 @@ type VersionedMap struct { } // Words are a set of options to represent an emoji. -// Possible options could be the ":colon_notation:" or a "U+26CF" style codepoint. +// Possible options could be the ":colon_notation:", a "U+26CF" style +// codepoint, or the unicode value itself. type Words []string // IsColonNotation checks for whether a word is the :colon_notation: of emoji @@ -36,7 +37,7 @@ func IsColonNotation(word string) bool { return strings.HasPrefix(word, ":") && strings.HasSuffix(word, ":") } -// IsCodepoint checks for whether a word is the "U+1234" codepoint style of emoji +// IsCodepoint checks for whether a word is the "U+1234" codepoint style of emoji. Codepoints can sometimes be a combo, like flags func IsCodepoint(word string) bool { return strings.HasPrefix(strings.ToUpper(word), "U+") }