Documentation
¶
Overview ¶
Package tr51 implements a parser for TR51 data from Unicode (https://unicode.org/Public/emoji/).
Index ¶
Constants ¶
View Source
const (
// VS16 is the "Variation Selector 16" rune, commonly known as "emoji mode".
VS16 = 0xfe0f
)
Variables ¶
View Source
var ( // ErrInvalidRange indicates bad TR51 data. ErrInvalidRange = errors.New("invalid emoji range") // ErrUnhandledEscape indicates that an unhandled escape was reached. // This library special-cases escapes as there's not many of them. ErrUnhandledEscape = errors.New("unhandled \\x escape code") )
Functions ¶
func Origins ¶
Origins converts a space-separated list of origins from the Emoji 1.0 data, to long-form text useful for types.
Types ¶
type Line ¶
type Line struct {
Single rune // for single rune emoji
Low, High rune // for low/high pairs e.g., AAAA..BBBB
Sequence []rune // for runs of emoji e.g., 1F468 200D 2764 FE0F
Version float32 // unicode version
Notes string // trailing notes as part of comment
Properties []string // ;-separated properties
}
Line represents all possible raw line parts of a TR51 doc.
func (*Line) AsSequence ¶
AsSequence returns single or sequenced emoji as a sequence.
func (*Line) AsString ¶
AsString returns single or sequenced emoji as a string, or returns an empty stirng.
func (*Line) HasProperty ¶
HasProperty returns whether this line has the given property.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main of datagen generates processed emoji data as a ESM for JavaScript.
|
Package main of datagen generates processed emoji data as a ESM for JavaScript. |
|
Package main will print all emoji from the latest revision, except unqualified emoji.
|
Package main will print all emoji from the latest revision, except unqualified emoji. |
|
Package emoji provides some higher-level abstractions over the emoji-data.txt and emoji-test.txt TR51 data files.
|
Package emoji provides some higher-level abstractions over the emoji-data.txt and emoji-test.txt TR51 data files. |
Click to show internal directories.
Click to hide internal directories.