Installation
Install the package
sh
composer require pg-momik/no-nepali-profanityRequirements
- PHP 8.2 or later.
- The
intlextension, for Unicode normalization, andmbstring. Both are enabled in most PHP builds; runphp -mto check.
The package has no other dependencies.
Import it
Everything is in the NoNepaliProfanity namespace, and Composer's autoloader loads it:
php
require __DIR__ . '/vendor/autoload.php';
use NoNepaliProfanity\Profanity;
Profanity::containsProfanity('muji'); // trueProfanity has a static method for each function. For fixed options, Profanity::createFilter() returns a ProfanityFilter object with the same methods; see Reuse a filter.