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 3d 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 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity48

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

2488d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0f2ed5a4460325034acb65b5c729f043066d5098d17851e27497786a357c374?d=identicon)[Devil0023](/maintainers/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

[bobey/geoip2-geolite2-composer

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.

17838.7k1](/packages/bobey-geoip2-geolite2-composer)[raoul2000/yii-simple-workflow

A simple workflow engine for Yii 1

278.2k](/packages/raoul2000-yii-simple-workflow)

PHPackages © 2026

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