transform

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package transform provides various string manipulation and sanitization functions.

Index

Constants

This section is empty.

Variables

LatinExtendedAdditionalMapping contains a slice of all string transformers chained together which is used as additional mapping for PRECIS profile.

LatinExtendedPrecisProfile is a Unicode PRECIS profile which prepare strings for a more secure comparison.

View Source
var LatinExtendedSanitize = factory.MakeStringTransformFunction(
	LatinExtendedPrecisProfile.NewTransformer(),
)

LatinExtendedSanitize sanitizes an input string via various string sanitization methods related to Extended Latin scripts.

View Source
var RespaceTransformer transform.SpanningTransformer = &respaceSpanningTransformer{}

RespaceTransformer is a Unicode stream transformer object which removes all leading and trailing white-spaces, then it reduces all inter-word white-spaces into a single normal space.

View Source
var StripNonPrintTransformer = runes.Remove(runes.NotIn(runedata.PrintsAndWhiteSpaces))

StripNonPrintingTransform is a Unicode stream transformer object which removes all occurrences of non-printing and non-spacing rune characters from a string.

View Source
var ToNormalHyphenTransformer = runes.Map(func(r rune) rune {
	if unicode.Is(runedata.HyphensAndDashes, r) {
		return '-'
	}
	return r
})

ToNormalHyphenTransformer is a Unicode stream transformer object which replaces all dash or hyphen characters into a normal hyphen.

View Source
var ToNormalSpaceTransformer = runes.Map(func(r rune) rune {
	if unicode.Is(unicode.White_Space, r) {
		return ' '
	}
	return r
})

ToNormalSpaceTransformer is a Unicode stream transformer object which replaces all white space rune characters into a normal space.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package thai is a subpackage that provides additional string sanitization functions that are customized for Thai characters and scripts.
Package thai is a subpackage that provides additional string sanitization functions that are customized for Thai characters and scripts.

Jump to

Keyboard shortcuts

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