Skip to content

Put another nickel in the swearjar. Simple profanity detection with content analysis.

Notifications You must be signed in to change notification settings

mainakibui/swearjar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Mike Foley
Feb 24, 2016
86bcdb8 · Feb 24, 2016

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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")

About

Put another nickel in the swearjar. Simple profanity detection with content analysis.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%