mirror of
https://github.com/emojisum/emojisum.git
synced 2025-08-03 13:50:27 +00:00
emoji: more of a draft of a convention
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
2332d1260c
commit
3efa665df0
8 changed files with 637 additions and 536 deletions
20
emoji/map.go
20
emoji/map.go
|
@ -1,9 +1,25 @@
|
|||
//go:generate go run map_json.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) string {
|
||||
return sumList[int(b)]
|
||||
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 []string `json:"emojiwords"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue