This is a small Golang module for dealing with profanity in english and hindi. This Module has functionalities for detecting bad words and cleaning them. Technologies used : Golang
go get -u github.com/surajJha/go-profanity-hindi
import profanity "github.com/surajJha/go-profanity-hindi"
No dependencies
inputMessage := "Hi John, you are a bitch"
result := MaskProfanity(inputMessage, "*")
log.Print(result) // Hi John, you are a *****
inputMessage := "Hi John, you are a bitch"
result := MaskProfanity(inputMessage, "#")
log.Print(result) // Hi John, you are a #####
inputMessage := "Hi John, stop being a bitch"
result := IsStringDirty(inputMessage)
log.Print(result) // true
inputMessage := "Hi John, how are you"
result := IsStringDirty(inputMessage)
log.Print(result) // false
words := []string{"asshole", "fucker"}
result, err := AddWords(words)
log.Print(result) // words that are added
words := []string{"asshole", "fucker"}
result, err := RemoveWords(words)
log.Print(result) // words that are removed
Run command - go test -v
MIT License