21 lines
396 B
Go
21 lines
396 B
Go
|
package tagengine
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"git.crumpington.com/lib/tagengine/sanitize"
|
||
|
)
|
||
|
|
||
|
// 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
|
||
|
}
|