2016-12-13 19:02:39 +00:00
|
|
|
//go:generate go run map_json.go -in ./emojimap.json -out ./map_gen.go
|
2016-12-13 17:56:45 +00:00
|
|
|
|
|
|
|
package emoji
|
|
|
|
|
|
|
|
// Map returns the emoji at the provided position.
|
|
|
|
// This list is from 0-255
|
2017-02-07 15:17:50 +00:00
|
|
|
func Map(b byte) Words {
|
2016-12-13 19:02:39 +00:00
|
|
|
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)
|
2017-02-07 15:17:50 +00:00
|
|
|
EmojiWords []Words `json:"emojiwords"`
|
2016-12-13 17:56:45 +00:00
|
|
|
}
|
2017-02-07 15:17:50 +00:00
|
|
|
|
|
|
|
// 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
|