go/tagengine/sanitize.go

21 lines
399 B
Go
Raw Normal View History

2024-11-11 05:36:55 +00:00
package tagengine
import (
"strings"
2024-11-11 08:22:50 +00:00
"git.crumpington.com/lib/go/tagengine/sanitize"
2024-11-11 05:36:55 +00:00
)
// The basic sanitizer:
// * lower-case
// * put spaces around numbers
// * put slaces around punctuation
// * collapse multiple spaces
func BasicSanitizer(s string) string {
s = strings.ToLower(s)
s = sanitize.SpaceNumbers(s)
s = sanitize.SpacePunctuation(s)
s = sanitize.CollapseSpaces(s)
return s
}