ccc

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package ccc returns the Unicode [Canonical Combining Class] value for a codepoint.

[Canonical Combining Class: https://unicode.org/reports/tr44/#Canonical_Combining_Class_Values

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxNonStarters = fmt.Errorf("illegal input: contains a sequence of more than %d non-starters", maxSeenNonStarters)
View Source
var Transformer = transform.Transformer(orderer{})

Transformer implements the transform.Transform interface to apply the Unicode Canonical Ordering Algorithm across its input. It outputs ordered Unicode.

If the input contains more than 30 non-starters in sequence (usually this means it is a maliciously crafted input), an error is returned.

The returned transformer is stateless, so may be used concurrently.

Functions

func Reorder

func Reorder(xs []byte) error

Reorder performs the Unicode Canonical Ordering Algorithm on a slice of bytes encoding a UTF-8 sequence.

If the input contains more than 30 non-starters in sequence (usually this means it is a maliciously crafted input), an error is returned.

func ReorderRunes

func ReorderRunes(xs []rune) error

ReorderRunes performs the Unicode Canonical Ordering Algorithm on a slice of runes.

func ReorderString

func ReorderString(xs string) (string, error)

Types

type CCC

type CCC uint8

CCC is a Unicode Canonical Combining Class value

func Of

func Of(c rune) CCC

Of returns the Unicode Canonical Combining Class for a specific codepoint. Note that we do not distinguish between CCC(0) (Not_Reordered) and a missing value for an invalid rune.

Jump to

Keyboard shortcuts

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