Download the PHP package linegg/word-detector without Composer
On this page you can find all versions of the php package linegg/word-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download linegg/word-detector
More information about linegg/word-detector
Files in linegg/word-detector
Download linegg/word-detector
More information about linegg/word-detector
Files in linegg/word-detector
Vendor linegg
Package word-detector
Short Description This is a PHP package for detecting sensitive words and shielded words. It has comprehensive functions and is easy to use.
License MIT
Package word-detector
Short Description This is a PHP package for detecting sensitive words and shielded words. It has comprehensive functions and is easy to use.
License MIT
Please rate this library. Is it a good library?
Informations about the package word-detector
word-detector - An easy-to-use vocabulary detection class for PHP
Introduction
- Simple and easy to use sensitive word detection package, and supports ignoring English case.
- PHP >= 7.0
Features
- Search for the hit shielded words and calculate the number of hits
- Replace the shield word with a custom symbol, such as '*'
- Customize invalid characters. Matching will automatically skip when these characters are encountered
- The case of English characters is ignored when matching
Installation
A Simple Example
<?php
// string to be detected
$content = 'hello a-bxx,you are a efg!';
// vocabulary array
$badWords = ['ab','efg'];
$wd = new \Linegg\WordDetector\WordDetector();
// build a trie
$wd->buildTree($badWords);
// configure negligible characters,such as' - ',' ~ '
$wd->setInvalidWords([' ','-']);
// return values includes hit times, hit words, original words and replaced strings
List($matchTime, $matchWords, $strWords, $replaceStr) = $wd->search($content, 0, true);
All versions of word-detector with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package linegg/word-detector contains the following files
Loading the files please wait ....