Skip to content
Daniel Tischner edited this page Jul 16, 2017 · 6 revisions

Getting started

  • Integrate Grawlox into your project.
  • Prepare the list of words that should be blacklisted, by default located in swearwords.txt
  • Create an instance of Grawlox by using a factory method, for example Grawlox#createFromDefault
  • Take a look into GrawloxExample.java for more usage hints (in the example swearwords are foo and bar).

GrawloxSample

Blacklist - Format

The list of swearwords must contain exactly one word per line. Comments can be made by starting a line with #.

As words will be converted to lower case and special characters as well as leetspeak will get removed, it is not necessary to add words like 'foo', 'Foo', 'f0o' multiple times.

Methods

Grawlox offers the following methods:

  • isProfane(String) - Whether the given input is profane, i.e. if it contains swearwords
  • detect(String) - Detects and returns all swearwords found in the given input
  • filter(String) and filter(String, char) - Filters the given input by censoring all detected swearwords with a substitue
  • examine(String) - Examines the given input for swearwords and returns detailed results
Clone this wiki locally