Regexp::Profanity::US - Perl extension for detecting profanity
use Regexp::Profanity::US; my $degree = 'definite'; # or 'ambiguous'; my @profane = profane_list($string, $degree); my $profane = profane ($string, $degree);
This module provides an API for checking strings for strings containing various degrees of profanity, per US standards.
Check $string for profanity of degree $degree, where $degree eq 'definite' or $degree eq 'ambiguous'
$string
$degree
For positive matches, returns TRUE, with TRUE being the first match in the string.
For negative matches, FALSE is returned.
The sub returns a list of all profane words found in $string, or an empty list if none were found.
profane() and profane_list
profane()
profane_list
Regexp::Any
There is another module supporting profanity checking, namely: Regexp::Common::profanity, but I had several issues with making practical use of it:
Many of the profane words were of European origin
I did not find them profane at all from an American standpoint.
I could not easily add profane words to that module
It uses a rotated character set. I would be happy to roll this into Regexp::Common if possible.
T. M. Brannon, tbone@cpan.org
To install Regexp::Profanity::US, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Regexp::Profanity::US
CPAN shell
perl -MCPAN -e shell install Regexp::Profanity::US
For more information on module installation, please visit the detailed CPAN module installation guide.