emoji

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: BSD-3-Clause, Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package emoji implements Unicode UTS #51 emoji classes.

License

This project is provided under the terms of the UNLICENSE or the 3-Clause BSD license denoted by the following SPDX identifier:

SPDX-License-Identifier: 'Unlicense' OR 'BSD-3-Clause'

You may use the project under the terms of either license.

Licenses are reproduced in the license file in the root folder of this module.

Copyright © 2021 Norbert Pillmayer <norbert@pillmayer.com>

Attention

Before using emoji classes, clients will have to initialize them.

SetupEmojiClasses()

This initializes all the code-point range tables. Initialization is not done beforehand, as it consumes quite some memory.

Index

Constants

This section is empty.

Variables

View Source
var Emoji, Emoji_Presentation, Emoji_Modifier, Emoji_Modifier_Base, Emoji_Component, Extended_Pictographic *unicode.RangeTable

Range tables for emoji code-point classes. Will be initialized with SetupEmojisClasses(). Clients can check with unicode.Is(..., rune)

Functions

func SetupEmojisClasses

func SetupEmojisClasses()

SetupEmojisClasses is the top-level preparation function: Create code-point classes for emojis. (Concurrency-safe).

Types

type EmojisClass

type EmojisClass int

Type for UTS#51 emoji code-point classes. Must be convertable to int.

const (
	EmojiClass                 EmojisClass = 0
	Emoji_PresentationClass    EmojisClass = 1
	Emoji_ModifierClass        EmojisClass = 2
	Emoji_Modifier_BaseClass   EmojisClass = 3
	Emoji_ComponentClass       EmojisClass = 4
	Extended_PictographicClass EmojisClass = 5
)

These are all the emoji breaking classes.

func EmojisClassForRune

func EmojisClassForRune(r rune) EmojisClass

EmojisClassForRune is the top-level client function: Get the emoji class for a Unicode code-point Will return -1 if the code-point has no emoji-class.

func (EmojisClass) String

func (c EmojisClass) String() string

Stringer for type EmojisClass

Directories

Path Synopsis
internal
generator
Package for a generator for UTS#51 Emoji character classes.
Package for a generator for UTS#51 Emoji character classes.

Jump to

Keyboard shortcuts

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