PHPackages                             linshaoneng/sensitive-word - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. linshaoneng/sensitive-word

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

linshaoneng/sensitive-word
==========================

Using DFA algorithm to check whether sensitive words are included

v0.1(5y ago)04proprietaryPHPPHP &gt;=7.0.0

Since May 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/linshaoneng/sensitive-word)[ Packagist](https://packagist.org/packages/linshaoneng/sensitive-word)[ RSS](/packages/linshaoneng-sensitive-word/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

敏感词检测/SensitiveWord
===================

[](#敏感词检测sensitiveword)

使用dfa算法检查是否包含敏感词/Using DFA algorithm to check whether sensitive words are included

安装/Installation
---------------

[](#安装installation)

```
$ composer require linshaoneng/sensitive-word
```

使用方法 $badWords 为需要检查的敏感词/Basic Usage
------------------------------------

[](#使用方法-badwords-为需要检查的敏感词basic-usage)

```
require_once "./vendor/autoload.php";

use linshaoneng\Sensitive\SensitiveWordTree;

$Sensitive = new SensitiveWordTree();

$badWords = ['发票','口罩'];
$Sensitive->addWordstoTree( $badWords );
$text1 = '发票，发票要吗？口罩也有';
$text2 = '团结友善';
print_r( $Sensitive->checkBadWords($text1));
print_r( $Sensitive->checkBadWords($text2));
```

\##返回如下

```
包含敏感词信息：
Array
(
    [0] => 发票
    [1] => 口罩
)
并无敏感词信息
Array(

)
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b58234a1a29992257b0f9f5da45a956e312b5e29b9a59525ac36cb5184b33b09?d=identicon)[linshaoneng](/maintainers/linshaoneng)

---

Top Contributors

[![linshaoneng](https://avatars.githubusercontent.com/u/3212249?v=4)](https://github.com/linshaoneng "linshaoneng (5 commits)")

### Embed Badge

![Health badge](/badges/linshaoneng-sensitive-word/health.svg)

```
[![Health](https://phpackages.com/badges/linshaoneng-sensitive-word/health.svg)](https://phpackages.com/packages/linshaoneng-sensitive-word)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M448](/packages/nette-forms)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
