PHPackages                             guda/php-dfa - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. guda/php-dfa

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

guda/php-dfa
============

Find keywords by using DFA.

v0.6(6y ago)311PHP

Since Jul 23Pushed 6y agoCompare

[ Source](https://github.com/Devil0023/php-dfa)[ Packagist](https://packagist.org/packages/guda/php-dfa)[ RSS](/packages/guda-php-dfa/feed)WikiDiscussions master Synced 2w ago

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

guda/phpdfa
===========

[](#gudaphpdfa)

一个基于DFA实现的关键词检测包。

安装
--

[](#安装)

```
composer require guda/php-dfa

```

使用
--

[](#使用)

### 初始化词库文件

[](#初始化词库文件)

```
$path = __DIR__;
$raw = $path.'/storage/logs/raw';  // 词库目录
$map = $path.'/storage/logs/map';  // 映射文件目录

(new InitWordsMap($raw, $map))->initMap();

```

### 检测文本

[](#检测文本)

```
$path = __DIR__;
$raw = $path.'/storage/logs/raw';  // 词库目录
$map = $path.'/storage/logs/map';  // 映射文件目录

$obj = (new CheckWords($raw, $map));
$obj->setMap('illegal');           // 词库名称（取自词库文件名）
var_dump($obj->check('我是测试字段'));

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

2534d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18282065?v=4)[Devil0023](/maintainers/Devil0023)[@Devil0023](https://github.com/Devil0023)

### Embed Badge

![Health badge](/badges/guda-php-dfa/health.svg)

```
[![Health](https://phpackages.com/badges/guda-php-dfa/health.svg)](https://phpackages.com/packages/guda-php-dfa)
```

###  Alternatives

[wiebenieuwenhuis/filament-char-counter

Count the amount of characters in a field

278.6k](/packages/wiebenieuwenhuis-filament-char-counter)[sideclick/bootstrap-modal-bundle

Bundle for Symfony 3.4+ that makes it easy to load pages into a Bootstrap modal window.

1715.9k](/packages/sideclick-bootstrap-modal-bundle)

PHPackages © 2026

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