New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bad_word_detector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bad_word_detector

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

BadWordDetector

Swear word detector

Ruleset is not complete. If you want to use it in your project, please edit lib/config/rules.yaml or use your own ruleset!

Installation

Add this line to your application's Gemfile:

gem 'bad_word_detector'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bad_word_detector

Usage

Detects #uck , F|_|__C_K and other variations of hidden swear words in text.

Usage:

finder = BadWordDetector.new
finder.find("What the #uck")

it will return BadWord object

Transformation rules is defined in form:

{"#" => {"symbol"=>"f", "weight" => 2}} # weight is optional

Or in file conf/rules.yaml

List of swear words is located in conf/library.yaml

Whitelist of english words in conf/whitelist.yaml

You can also set own rules:

finder = BadWordDetector.new rules, library, whitelist

Or you can use string filenames for YAML files of same format:

finder = BadWordDetector.new 'my_rules.yaml', 'my_library.yaml', 'my_whitelist.yaml'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 16 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc