uset

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/**
	 * Minimum value that can be stored in a UnicodeSet.
	 * @stable ICU 2.4
	 */
	MinValue = 0

	/**
	 * Maximum value that can be stored in a UnicodeSet.
	 * @stable ICU 2.4
	 */
	MaxValue = 0x10ffff
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter func(ch rune) bool

type USet

type USet uint32
const (
	/**
	 * Ignore white space within patterns unless quoted or escaped.
	 * @stable ICU 2.4
	 */
	IgnoreSpace USet = 1

	/**
	 * Enable case insensitive matching.  E.g., "[ab]" with this flag
	 * will match 'a', 'A', 'b', and 'B'.  "[^ab]" with this flag will
	 * match all except 'a', 'A', 'b', and 'B'. This performs a full
	 * closure over case mappings, e.g. U+017F for s.
	 *
	 * The resulting set is a superset of the input for the code points but
	 * not for the strings.
	 * It performs a case mapping closure of the code points and adds
	 * full case folding strings for the code points, and reduces strings of
	 * the original set to their full case folding equivalents.
	 *
	 * This is designed for case-insensitive matches, for example
	 * in regular expressions. The full code point case closure allows checking of
	 * an input character directly against the closure set.
	 * Strings are matched by comparing the case-folded form from the closure
	 * set with an incremental case folding of the string in question.
	 *
	 * The closure set will also contain single code points if the original
	 * set contained case-equivalent strings (like U+00DF for "ss" or "Ss" etc.).
	 * This is not necessary (that is, redundant) for the above matching method
	 * but results in the same closure sets regardless of whether the original
	 * set contained the code point or a string.
	 *
	 * @stable ICU 2.4
	 */
	CaseInsensitive USet = 2

	/**
	 * Enable case insensitive matching.  E.g., "[ab]" with this flag
	 * will match 'a', 'A', 'b', and 'B'.  "[^ab]" with this flag will
	 * match all except 'a', 'A', 'b', and 'B'. This adds the lower-,
	 * title-, and uppercase mappings as well as the case folding
	 * of each existing element in the set.
	 * @stable ICU 3.2
	 */
	AddCaseMappings USet = 4
)

type UnicodeSet

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

func New

func New() *UnicodeSet

func (*UnicodeSet) AddAll

func (u *UnicodeSet) AddAll(u2 *UnicodeSet)

func (*UnicodeSet) AddRune

func (u *UnicodeSet) AddRune(c rune)

func (*UnicodeSet) AddRuneRange

func (u *UnicodeSet) AddRuneRange(start, end rune)

func (*UnicodeSet) AddString

func (u *UnicodeSet) AddString(chars string)

func (*UnicodeSet) ApplyFilter

func (u *UnicodeSet) ApplyFilter(inclusions *UnicodeSet, filter Filter)

func (*UnicodeSet) Clear

func (u *UnicodeSet) Clear()

func (*UnicodeSet) Clone

func (u *UnicodeSet) Clone() *UnicodeSet

func (*UnicodeSet) CloseOver

func (u *UnicodeSet) CloseOver(attribute USet)

func (*UnicodeSet) Complement

func (u *UnicodeSet) Complement()

func (*UnicodeSet) ContainsRune

func (u *UnicodeSet) ContainsRune(c rune) bool

func (*UnicodeSet) ContainsRuneRange

func (u *UnicodeSet) ContainsRuneRange(from, to rune) bool

func (*UnicodeSet) CopyFrom

func (u *UnicodeSet) CopyFrom(set *UnicodeSet)

func (*UnicodeSet) Equals

func (u *UnicodeSet) Equals(other *UnicodeSet) bool

func (*UnicodeSet) Freeze

func (u *UnicodeSet) Freeze() *UnicodeSet

func (*UnicodeSet) FreezeCheck_

func (u *UnicodeSet) FreezeCheck_() error

func (*UnicodeSet) IsEmpty

func (u *UnicodeSet) IsEmpty() bool

func (*UnicodeSet) Len

func (u *UnicodeSet) Len() (n int)

func (*UnicodeSet) RangeCount

func (u *UnicodeSet) RangeCount() int

func (*UnicodeSet) RangeEnd

func (u *UnicodeSet) RangeEnd(idx int) rune

func (*UnicodeSet) RangeStart

func (u *UnicodeSet) RangeStart(idx int) rune

func (*UnicodeSet) RemoveAll

func (u *UnicodeSet) RemoveAll(c *UnicodeSet)

func (*UnicodeSet) RemoveRuneRange

func (u *UnicodeSet) RemoveRuneRange(start, end rune)

func (*UnicodeSet) RetainAll

func (u *UnicodeSet) RetainAll(c *UnicodeSet)

func (*UnicodeSet) RuneAt

func (u *UnicodeSet) RuneAt(idx int) rune

func (*UnicodeSet) String

func (u *UnicodeSet) String() string

func (*UnicodeSet) ToPattern

func (u *UnicodeSet) ToPattern(w *strings.Builder, escapeUnprintable bool)

Jump to

Keyboard shortcuts

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