mirror of
https://github.com/emojisum/emojisum.git
synced 2024-11-15 20:28:37 +00:00
Vincent Batts
62919c069f
Per https://github.com/vbatts/emojisum/issues/5 there are some options in this list that are better expressed as a unicode codepoint. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
29 lines
845 B
Go
29 lines
845 B
Go
//go:generate go run map_json.go -in ./emojimap.json -out ./map_gen.go
|
|
|
|
package emoji
|
|
|
|
// Map returns the emoji at the provided position.
|
|
// This list is from 0-255
|
|
func Map(b byte) Words {
|
|
return mapGen.EmojiWords[int(b)]
|
|
}
|
|
|
|
// Version returns the version of the emojisum document currently compiled
|
|
// against
|
|
func Version() string {
|
|
return mapGen.Version
|
|
}
|
|
|
|
var mapGen VersionedMap
|
|
|
|
// VersionedMap is the structure used for the `emojimap.json` document
|
|
type VersionedMap struct {
|
|
Description string `json:"description"`
|
|
Version string `json:"version"`
|
|
// these are an ordered list, referened by a byte (each byte of a checksum digest)
|
|
EmojiWords []Words `json:"emojiwords"`
|
|
}
|
|
|
|
// Words are a set of options to represent an emoji.
|
|
// Possible options could be the ":colon_notion:" or a "U+26CF" style codepoint.
|
|
type Words []string
|