PHPackages                             minuux/simpledict - 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. minuux/simpledict

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

minuux/simpledict
=================

SimpleDict

1.1.0(9y ago)1231PHPPHP &gt;=5.3.3

Since Feb 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/minuux/simpledict)[ Packagist](https://packagist.org/packages/minuux/simpledict)[ RSS](/packages/minuux-simpledict/feed)WikiDiscussions master Synced today

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

SimpleDict
==========

[](#simpledict)

这是一个简单快速的词库工具，用来从一段文本中找出存在于词库的词语。

特点
--

[](#特点)

> - **简单**：纯 PHP 实现，无需安装扩展。
> - **快速**：查找耗时跟词库大小关系不大（我的小破本上查询 40 万的词库轻轻松松），不会一次性加载整个词库，使用时内存占用小（就是生成词库的时候有点费内存）。

使用方法
----

[](#使用方法)

**准备文本格式的词库**

首先准备一个文本文件，每个词占一行。格式：

> `词语值`

**生成 SimpleDict 专用词库**

```
SimpleDict::make("text_file_path", "output_dict_path");

```

**搜索**

```
$dict = new SimpleDict("dict_path");
$result = $dict->search("some text here...");

/* $result 的格式：
array(
  'word1' => array('value' => 'value1', 'count' => 'count1'),
  ...
)*/

```

**替换**

```
// 简单替换
$replaced = $dict->replace("some text here...", "**");
// 高级替换
$replaced = $dict->replace("some text here...", function($word, $value) {
  return "[$word -> $value]";
});

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.8% 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

Every ~1 days

Total

2

Last Release

3425d ago

### Community

Maintainers

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

---

Top Contributors

[![nowgoo](https://avatars.githubusercontent.com/u/260203?v=4)](https://github.com/nowgoo "nowgoo (7 commits)")[![minuux](https://avatars.githubusercontent.com/u/1884625?v=4)](https://github.com/minuux "minuux (4 commits)")[![sillydong](https://avatars.githubusercontent.com/u/1894696?v=4)](https://github.com/sillydong "sillydong (2 commits)")

### Embed Badge

![Health badge](/badges/minuux-simpledict/health.svg)

```
[![Health](https://phpackages.com/badges/minuux-simpledict/health.svg)](https://phpackages.com/packages/minuux-simpledict)
```

###  Alternatives

[odiseoteam/sylius-blog-plugin

This plugin add blog capabilities to your Sylius project

37107.2k](/packages/odiseoteam-sylius-blog-plugin)[alexandre-daubois/lazy-stream

Write data to streams, only when it is really needed to.

735.8k](/packages/alexandre-daubois-lazy-stream)

PHPackages © 2026

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