https://github.com/snicol/swearjar-go
Profanity detection in Go
https://github.com/snicol/swearjar-go
Last synced: 3 months ago
JSON representation
Profanity detection in Go
- Host: GitHub
- URL: https://github.com/snicol/swearjar-go
- Owner: snicol
- License: mit
- Created: 2017-07-26T16:27:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-08T12:55:38.000Z (over 7 years ago)
- Last Synced: 2025-01-30T01:26:59.053Z (4 months ago)
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# swearjar-go
[
](https://travis-ci.org/snicol/swearjar-go) [](http://godoc.org/github.com/snicol/swearjar-go) [](https://goreportcard.com/report/snicol/swearjar-go)
Install:
go get github.com/snicol/swearjar-go
# Usageswears, err := swearjar.Load()
if err != nil {
log.Fatal(err)
}
profane, reasons, err := swears.Scorecard("ass") // = true, []string{"insult"}, nil
profane, err = swears.Profane("flower") // = false, nil
The swear list used is bundled in swearjar.go, however using this format you can load your own using `Load()`:{
"swear": ["insult", "provactive"],
... repeat
}
And in your code:swears, _ := swearjar.Load("custom.json")
# Notes
There is currently no `censor` feature like the other swearjar projects.
This is regex based and is not optimised in the slightest.
# Acknowledgements
This is based on [Swearjar](https://github.com/joshbuddy/swearjar) for Ruby and uses the JSON config from
[swearjar-node](https://github.com/raymondjavaxx/swearjar-node).