Skip to content
Put another nickel in the swearjar. Simple profanity detection with content analysis.
Ruby
Latest commit 86bcdb8 Feb 24, 2016 @m1foley m1foley Add boob/boobs
Failed to load latest commit information.
lib Add boob/boobs Feb 24, 2016
spec Add acceptance test: the Seven Dirty Words routine Feb 15, 2016
.gitignore cleanup Oct 16, 2011
.travis.yml Add Travis CI config Jan 31, 2016
CHANGELOG.md Bump version to 1.1.0 Feb 13, 2016
Gemfile Update RubyGems source to HTTPS Jan 31, 2016
README.md
Rakefile Bump RSpec version Jan 31, 2016
swearjar.gemspec Fix reference in gemspec Feb 13, 2016

README.md

Swearjar

Simple profanity detection with content analysis.

Installation

gem install swearjar

Usage

require "swearjar"

sj = Swearjar.default

sj.profane?("jim henson has a massive hard on he is gonna use to fuck everybody")
# => true

sj.scorecard("jim henson has a massive hard on he is gonna use to fuck everybody")
# => {:sexual => 2}

sj.censor("jim henson has a massive hard on he is gonna use to fuck everybody")
# => "jim henson has a massive **** ** he is gonna use to **** everybody"

To load from a custom config file, you can do the following:

# For an example see lib/config/en.yml
sj = Swearjar.new("my_swears.yml")
Something went wrong with that request. Please try again.