Skip to content

snicol/swearjar-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swearjar-go

Go Report Card

Install:

go get github.com/snicol/swearjar-go

Usage

swears, 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 for Ruby and uses the JSON config from swearjar-node.

About

Profanity detection in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages