ensip15

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FE0F = 0xFE0F
	ZWJ  = 0x200D
)

Variables

View Source
var (
	ErrInvalidLabelExtension = fmt.Errorf("invalid label extension")
	ErrIllegalMixture        = fmt.Errorf("illegal mixture")
	ErrWholeConfusable       = fmt.Errorf("whole-script confusable")
	ErrLeadingUnderscore     = fmt.Errorf("underscore allowed only at start")
	ErrFencedLeading         = fmt.Errorf("leading fenced")
	ErrFencedAdjacent        = fmt.Errorf("adjacent fenced")
	ErrFencedTrailing        = fmt.Errorf("trailing fenced")
	ErrDisallowedCharacter   = fmt.Errorf("disallowed character")
	ErrEmptyLabel            = fmt.Errorf("empty label")
	ErrCMLeading             = fmt.Errorf("leading combining mark")
	ErrCMAfterEmoji          = fmt.Errorf("emoji + combining mark")
	ErrNSMDuplicate          = fmt.Errorf("duplicate non-spacing marks")
	ErrNSMExcessive          = fmt.Errorf("excessive non-spacing marks")
)

Functions

func Beautify

func Beautify(name string) string

func FlattenTokens

func FlattenTokens(tokens []OutputToken) []rune

func Join

func Join(labels []string) string

func Normalize

func Normalize(name string) string

func Split

func Split(name string) []string

func ToHexSequence

func ToHexSequence(cps []rune) string

Types

type ENSIP15

type ENSIP15 struct {
	// contains filtered or unexported fields
}

func New

func New() *ENSIP15

func Shared

func Shared() *ENSIP15

func (*ENSIP15) ASCIIGroup

func (l *ENSIP15) ASCIIGroup() *Group

func (*ENSIP15) Beautify

func (l *ENSIP15) Beautify(name string) (string, error)

func (*ENSIP15) EmojiGroup

func (l *ENSIP15) EmojiGroup() *Group

func (*ENSIP15) Emojis

func (l *ENSIP15) Emojis() (v []EmojiSequence)

func (*ENSIP15) FindGroup

func (l *ENSIP15) FindGroup(name string) *Group

func (*ENSIP15) GetMapped

func (l *ENSIP15) GetMapped(cp rune) []rune

func (*ENSIP15) Groups

func (l *ENSIP15) Groups() (v []*Group)

func (*ENSIP15) Ignored

func (l *ENSIP15) Ignored() util.RuneSet

func (*ENSIP15) NF

func (l *ENSIP15) NF() *nf.NF

func (*ENSIP15) Normalize

func (l *ENSIP15) Normalize(name string) (string, error)

func (*ENSIP15) NormalizeFragment

func (l *ENSIP15) NormalizeFragment(frag string, decompose bool) (string, error)

func (*ENSIP15) ParseEmojiAt

func (l *ENSIP15) ParseEmojiAt(cps []rune, pos int) (emoji *EmojiSequence, end int)

func (*ENSIP15) SafeCodepoint

func (l *ENSIP15) SafeCodepoint(cp rune) string

func (*ENSIP15) SafeImplode

func (l *ENSIP15) SafeImplode(cps []rune) string

func (*ENSIP15) ShouldEscape

func (l *ENSIP15) ShouldEscape() util.RuneSet

type EmojiNode

type EmojiNode struct {
	// contains filtered or unexported fields
}

func (*EmojiNode) Child

func (node *EmojiNode) Child(cp rune) *EmojiNode

type EmojiSequence

type EmojiSequence struct {
	// contains filtered or unexported fields
}

func (EmojiSequence) Beautified

func (seq EmojiSequence) Beautified() string

func (EmojiSequence) HasZWJ

func (seq EmojiSequence) HasZWJ() bool

func (EmojiSequence) IsMangled

func (seq EmojiSequence) IsMangled() bool

func (EmojiSequence) Normalized

func (seq EmojiSequence) Normalized() string

func (EmojiSequence) String

func (seq EmojiSequence) String() string

type Group

type Group struct {
	// contains filtered or unexported fields
}

func (*Group) Contains

func (g *Group) Contains(cp rune) bool

func (*Group) IsRestricted

func (g *Group) IsRestricted() bool

func (*Group) Name

func (g *Group) Name() string

func (*Group) String

func (g *Group) String() string

type OutputToken

type OutputToken struct {
	Codepoints []rune
	Emoji      *EmojiSequence
}

func (OutputToken) String

func (ot OutputToken) String() string

type Whole

type Whole struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL