runes: github.com/martingallagher/runes Index | Files

package runes

import "github.com/martingallagher/runes"

Package runes provides functions to test some properties of Unicode code points.

Index

Package Files

runes.go tables.go

func IsControl Uses

func IsControl(r rune) bool

IsControl reports whether the rune is a control character. The C (Other) Unicode category includes more code points such as surrogates; use Is(C, r) to test for them.

func IsDigit Uses

func IsDigit(r rune) bool

IsDigit reports whether the rune is a decimal digit.

func IsDigitUnsafe Uses

func IsDigitUnsafe(r rune) bool

IsDigitUnsafe is the unsafe version of IsDigit.

func IsGraphic Uses

func IsGraphic(r rune) bool

IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories L, M, N, P, S, Zs.

func IsGraphicUnsafe Uses

func IsGraphicUnsafe(r rune) bool

IsGraphicUnsafe is the unsafe version of IsGraphic.

func IsLetter Uses

func IsLetter(r rune) bool

IsLetter reports whether the rune is a letter (category L).

func IsLetterUnsafe Uses

func IsLetterUnsafe(r rune) bool

IsLetterUnsafe is the unsafe version of IsLetter.

func IsLower Uses

func IsLower(r rune) bool

IsLower reports whether the rune is a lower case letter.

func IsLowerUnsafe Uses

func IsLowerUnsafe(r rune) bool

IsLowerUnsafe is the unsafe version of IsLower.

func IsMark Uses

func IsMark(r rune) bool

IsMark reports whether the rune is a mark character (category M).

func IsMarkUnsafe Uses

func IsMarkUnsafe(r rune) bool

IsMarkUnsafe is the unsafe version of IsMark.

func IsNumber Uses

func IsNumber(r rune) bool

IsNumber reports whether the rune is a number (category N).

func IsNumberUnsafe Uses

func IsNumberUnsafe(r rune) bool

IsNumberUnsafe is the unsafe version of IsNumber.

func IsPrint Uses

func IsPrint(r rune) bool

IsPrint reports whether the rune is defined as printable by Go. Such characters include letters, marks, numbers, punctuation, symbols, and the ASCII space character, from categories L, M, N, P, S and the ASCII space character. This categorization is the same as IsGraphic except that the only spacing character is ASCII space, U+0020.

func IsPrintUnsafe Uses

func IsPrintUnsafe(r rune) bool

IsPrintUnsafe is the unsafe version of IsPrint.

func IsPunct Uses

func IsPunct(r rune) bool

IsPunct reports whether the rune is a Unicode punctuation character (category P).

func IsPunctUnsafe Uses

func IsPunctUnsafe(r rune) bool

IsPunctUnsafe is the unsafe version of IsPunct.

func IsSpace Uses

func IsSpace(r rune) bool

IsSpace reports whether the rune is a space character as defined by Unicode's White Space property; in the Latin-1 space this is

'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).

Other definitions of spacing characters are set by category Z and property Pattern_White_Space.

func IsSpaceUnsafe Uses

func IsSpaceUnsafe(r rune) bool

IsSpaceUnsafe is the unsafe version of IsSpace.

func IsSymbol Uses

func IsSymbol(r rune) bool

IsSymbol reports whether the rune is a symbolic character.

func IsSymbolUnsafe Uses

func IsSymbolUnsafe(r rune) bool

IsSymbolUnsafe is the unsafe version of IsSymbol.

func IsTitle Uses

func IsTitle(r rune) bool

IsTitle reports whether the rune is a title case letter.

func IsTitleUnsafe Uses

func IsTitleUnsafe(r rune) bool

IsTitleUnsafe is the unsafe version of IsTitle.

func IsUpper Uses

func IsUpper(r rune) bool

IsUpper reports whether the rune is an upper case letter.

func IsUpperUnsafe Uses

func IsUpperUnsafe(r rune) bool

IsUpperUnsafe is the unsafe version of IsUpper.

func SimpleFold Uses

func SimpleFold(r rune) rune

SimpleFold iterates over Unicode code points equivalent under the Unicode-defined simple case folding. Among the code points equivalent to rune (including rune itself), SimpleFold returns the smallest rune > r if one exists, or else the smallest rune >= 0. If r is not a valid Unicode code point, SimpleFold(r) returns r.

For example:

SimpleFold('A') = 'a'
SimpleFold('a') = 'A'

SimpleFold('K') = 'k'
SimpleFold('k') = '\u212A' (Kelvin symbol, K)
SimpleFold('\u212A') = 'K'

SimpleFold('1') = '1'

SimpleFold(-2) = -2

func SimpleFoldUnsafe Uses

func SimpleFoldUnsafe(r rune) rune

SimpleFoldUnsafe is the unsafe version of SimpleFold.

func To Uses

func To(_case int, r rune) rune

To maps the rune to the specified case: UpperCase, LowerCase, or TitleCase.

func ToLower Uses

func ToLower(r rune) rune

ToLower maps the rune to lower case.

func ToLowerUnsafe Uses

func ToLowerUnsafe(r rune) rune

ToLowerUnsafe is the unsafe version of ToLower.

func ToTitle Uses

func ToTitle(r rune) rune

ToTitle maps the rune to title case.

func ToTitleUnsafe Uses

func ToTitleUnsafe(r rune) rune

ToTitleUnsafe is the unsafe version of ToTitle.

func ToUnsafe Uses

func ToUnsafe(_case int, r rune) rune

ToUnsafe is the unsafe version of To.

func ToUpper Uses

func ToUpper(r rune) rune

ToUpper maps the rune to upper case.

func ToUpperUnsafe Uses

func ToUpperUnsafe(r rune) rune

ToUpperUnsafe is the unsafe version of ToUpper.

Package runes imports 2 packages (graph). Updated 2018-03-11. Refresh now. Tools for package owners.