NAME
Regexp::Profanity::US - Perl extension for blah blah blah
SYNOPSIS
use Regexp::Profanity::US;
sub proc {
my $string = shift;
my $degree = shift;
my ($R, @M) = profane_list($string, $degree);
scalar @M > 7 and @M = @M[0..6];
my $i = 0;
tab_array;
for (@M) {
$tab_array[$i] = $M[$i++]
}
if ($R) {
++$counter{$degree};
$fh{$degree}->print("@tab_array\t$_");
}
$R
}
while (<B>) {
++$line;
next if proc($_, 'definite');
proc($_, 'ambiguous');
}
DESCRIPTION
This module provides an API for checking strings for strings containing various degrees of profanity.
API
profane($string, $degree)
Check $string
for profanity of degree $degree
, where $degree eq 'definite' or $degree eq 'ambiguous'
For positive matches, returns TRUE and the first matched in a list, meaning (1, $1) For negative matches, return FALSE.
profane_list($string, $degree)
Same arguments. The sub returns:
for positive matches, returns TRUE and all profane matches in a list, meaning (scalar @M, @M). for negative matches, return FALSE.
EXPORT
profane()
and profane_list
DEPENDENCIES
Regexp::Match::Any - by Scott McWhirter from CPAN but modified locally with patches submitted to author. Version 0.04 or higher is required.
OTHER
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 and I did not find them profane at all from an American standpoint.
- I could not easily add profane words to that module. Without question, Abigail is a regular expression genius bar none, the edit cycle to use the module would have required emailing him the changes. To make local changes for immediate use would have required doing character rotation on the characters first.
AUTHOR
T. M. Brannon