Aquarium Profanity Filter
Downloads
What is Aquarium?
Aquarium is an open source text filtering package written in PHP. It filters nearly all four-letter words, profanities, curses, and pornographic language from any text, while filtering nearly no benign words. Aquarium can keep your blog, forum, guestbook or other dynamic application clean and suitable for all ages.
Aquarium has a number of nice features:
- Aquarium is fast: it can process over 350 words per second!
- Uses an encrypted dictionary of almost 100 objectionable words, so you don't need to compile your own bad-words file and keep it plain-text on a server.
- The specially developed algorithm detects sound-alike as well as look-alike words to produce almost perfect text filtering.
- Aquarium is easy to set up and use.
- Integrates easily into other PHP and HTML web pages.
- Aquarium works with PHP versions 4.3 and greater.
Frequently Asked Questions
-
How do I download Aquarium?
Choose either the .zip or the .tar.gz file from the box to the right. Download the file and extract it using compressed file extraction program (like Universal Extractor, 7zip, or WinZip).
-
How do I install Aquarium?
In the extracted folder that you got from the process above (Aquarium-1.0), there is a folder called 'aquarium'. Copy this entire folder to your server's root directory.
-
How do I use Aquarium?
To use Aquarium in your PHP script, add the following code:
<?php require_once("/aquarium/filter.php" ); ?>Now suppose you have some text in a variable $unfiltered. You can make Aquarium filter the text like so:
<?php $filtered = filter($unfiltered ); echo $filtered[0]; // The text with all bad words replaced with asterisks echo $filtered[1]; // The number of seconds Aquarium took to filter the text echo $filtered[2]; // The total number of words there are in the text echo $filtered[3]; // The total number of words that were filtered ?>
Aquarium returns information about the filtering process in an array. You can use this information to do many things. For example:
<?php echo round( 100 * $filtered[3] / $filtered[2] ) ."% bad words"; echo round($filtered[2] / $filtered[1] ) ." words per second"; ?>
If you think you have found a bug or other problem, please let me know here.







