Documentation ¶
Index ¶
- Variables
- func IsProfane(s string) bool
- type ProfanityDetector
- func (g *ProfanityDetector) IsProfane(s string) bool
- func (g *ProfanityDetector) WithSanitizeAccents(sanitize bool) *ProfanityDetector
- func (g *ProfanityDetector) WithSanitizeLeetSpeak(sanitize bool) *ProfanityDetector
- func (g *ProfanityDetector) WithSanitizeSpecialCharacters(sanitize bool) *ProfanityDetector
Constants ¶
This section is empty.
Variables ¶
var Profanities = []string{
"anal",
"anus",
"arse",
"ass",
"ballsack",
"balls",
"bastard",
"bitch",
"btch",
"biatch",
"blowjob",
"bollock",
"bollok",
"boner",
"boob",
"bugger",
"butt",
"clit",
"cock",
"coon",
"crap",
"cum",
"cunt",
"dick",
"dildo",
"douchebag",
"dyke",
"fag",
"feck",
"fellate",
"fellatio",
"felching",
"fuck",
"fudgepacker",
"flange",
"gspot",
"gtfo",
"hoe",
"horny",
"incest",
"jerk",
"jizz",
"kink",
"labia",
"masturbat",
"muff",
"naked",
"nazi",
"ngger",
"nigga",
"niggr",
"niggu",
"nipple",
"nips",
"nude",
"pedo",
"penis",
"piss",
"poop",
"porn",
"prick",
"prostitut",
"pube",
"pussie",
"pussy",
"queer",
"rape",
"rapist",
"retard",
"rimjob",
"scrotum",
"sex",
"shit",
"slut",
"sperm",
"spunk",
"stfu",
"suckmy",
"tit",
"tranny",
"turd",
"twat",
"vagina",
"wank",
"whore",
"1488",
"8814",
}
profanities is a list of profanities that are checked after the falsePositives are removed
Note that some words that would normally be in this list may be in falseNegatives
Functions ¶
Types ¶
type ProfanityDetector ¶
type ProfanityDetector struct {
// contains filtered or unexported fields
}
ProfanityDetector
func NewProfanityDetector ¶
func NewProfanityDetector() *ProfanityDetector
NewProfanityDetector creates a new ProfanityDetector
func (*ProfanityDetector) IsProfane ¶
func (g *ProfanityDetector) IsProfane(s string) bool
IsProfane takes in a string (word or sentence) and look for profanities. Returns a boolean
func (*ProfanityDetector) WithSanitizeAccents ¶
func (g *ProfanityDetector) WithSanitizeAccents(sanitize bool) *ProfanityDetector
WithSanitizeAccents allows configuring of whether the sanitization process should also take into account accents. By default, this is set to true, but since this adds a bit of overhead, you may disable it if your use case is time-sensitive or if the input doesn't involve accents (i.e. if the input can never contain special characters)
func (*ProfanityDetector) WithSanitizeLeetSpeak ¶
func (g *ProfanityDetector) WithSanitizeLeetSpeak(sanitize bool) *ProfanityDetector
WithSanitizeLeetSpeak allows configuring whether the sanitization process should also take into account leetspeak
func (*ProfanityDetector) WithSanitizeSpecialCharacters ¶
func (g *ProfanityDetector) WithSanitizeSpecialCharacters(sanitize bool) *ProfanityDetector
WithSanitizeSpecialCharacters allows configuring whether the sanitization process should also take into account special characters