Documentation ¶
Overview ¶
Package transform provides various string manipulation and sanitization functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var LatinExtendedAdditionalMapping = []transform.Transformer{ runes.ReplaceIllFormed(), StripNonPrintTransformer, ToNormalSpaceTransformer, ToNormalHyphenTransformer, diacritics.AsciiFoldTransformer, diacritics.StripDiacriticalMarksTransformer, RespaceTransformer, }
LatinExtendedAdditionalMapping contains a slice of all string transformers chained together which is used as additional mapping for PRECIS profile.
var LatinExtendedPrecisProfile = precis.NewFreeform( precis.FoldWidth, precis.AdditionalMapping(func() transform.Transformer { return transform.Chain(LatinExtendedAdditionalMapping...) }), precis.FoldCase(cases.HandleFinalSigma(true)), )
LatinExtendedPrecisProfile is a Unicode PRECIS profile which prepare strings for a more secure comparison.
var LatinExtendedSanitize = factory.MakeStringTransformFunction( LatinExtendedPrecisProfile.NewTransformer(), )
LatinExtendedSanitize sanitizes an input string via various string sanitization methods related to Extended Latin scripts.
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.
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.
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.
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. |