libpf is a ReinfyTeam-maintained Virion library for detecting and filtering profanity in text. It provides static helpers for matching configured words, replacing matches, normalizing common Unicode lookalikes and retrieving the built-in English word list.
The library is intended to be included in a PocketMine-MP plugin or another compatible consumer. It is not a standalone plugin and does not provide a PHAR release by itself.
- PHP 8.1 or newer for development and analysis.
- A consumer that can package or load the Virion library.
- The current
virion.ymlmetadata lists Virion APIs1.0.0through5.0.0. This library has no direct PocketMine-MP runtime dependency; verify the consuming plugin separately on its target API.
The repository declares the Composer package name reinfyteam/libpf, but a Packagist listing was not verified. Configure the repository as a VCS/path dependency or include it through the consumer's supported Virion packaging flow. The libpf-ExamplePlugin repository demonstrates integration in a PocketMine-MP plugin.
The public class is ReinfyTeam\libpf\libpf:
use ReinfyTeam\libpf\libpf;
$words = ["example"];
if (libpf::detectProfanity($message, $words)) {
$filtered = libpf::removeProfanity($message, $words);
}The available helpers are:
detectProfanity(string $message, array $words): boolchecks whether a configured word matches.removeProfanity(string $message, array $words, string $replacementCharacter = "#"): stringreplaces matched words.removeUnicode(string $text, bool $include_unicode = false): stringnormalizes common lookalike characters and, when requested, removes the additional byte range handled by the current implementation.defaultProfanity(): list<string>returns the built-in English word list.
Use a listener in the consuming plugin when filtering chat, and make the moderation policy explicit to server administrators. The library does not cancel events, send messages or choose a punishment policy on behalf of the consumer.
Install the locked development dependencies and run the repository's maximum-level analysis:
composer install
composer analyseThis is a library/virion package, so packaging and runtime behavior must be verified through an appropriate consumer. Do not create a standalone plugin PHAR from this checkout or claim consumer compatibility from PHPStan alone.
For reproducible library issues, open an issue with the library revision, consumer project, PHP/runtime versions and a minimal input demonstrating the problem. Preserve upstream attribution and the existing public namespace when contributing compatibility fixes.
libpf is maintained by ReinfyTeam. The project is licensed under LGPL-2.1-only.