PHPackages                             xiaodi/think-pullword - 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. xiaodi/think-pullword

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

xiaodi/think-pullword
=====================

ThinkPHP 分词/抽词 扩展包

v1.2.1(5y ago)5512.1k—0%7MITPHP

Since Oct 29Pushed 5y ago3 watchersCompare

[ Source](https://github.com/edenleung/think-pullword)[ Packagist](https://packagist.org/packages/xiaodi/think-pullword)[ RSS](/packages/xiaodi-think-pullword/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

think-pullword
==============

[](#think-pullword)

ThinkPHP 分词/抽词 扩展包 `5.1` `6.0`

使用梁厂的产品

[![Latest Stable Version](https://camo.githubusercontent.com/3bc4000fecabba1192e351cd73f2275ae8e78b5f4a1309556638bef64ded20ad/68747470733a2f2f706f7365722e707567782e6f72672f7869616f64692f7468696e6b2d70756c6c776f72642f76657273696f6e)](https://packagist.org/packages/xiaodi/think-pullword)[![Latest Unstable Version](https://camo.githubusercontent.com/00a50e18dd6a8dfa19c1a0f247fb16f46e19d0d0689149745fe21b9fdcd7bb07/68747470733a2f2f706f7365722e707567782e6f72672f7869616f64692f7468696e6b2d70756c6c776f72642f762f756e737461626c65)](https://packagist.org/packages/xiaodi/think-pullword)[![License](https://camo.githubusercontent.com/06fa3025584308f9417edf3a496aec6e953daa197ad3725acf92fa2430bf5f65/68747470733a2f2f706f7365722e707567782e6f72672f7869616f64692f7468696e6b2d70756c6c776f72642f6c6963656e7365)](https://packagist.org/packages/xiaodi/think-pullword)[![Total Downloads](https://camo.githubusercontent.com/d7e8c5dab204db88b73aabf9a5b01ee9603adc0acd54816c8618618de79bbc6b/68747470733a2f2f706f7365722e707567782e6f72672f7869616f64692f7468696e6b2d70756c6c776f72642f646f776e6c6f616473)](https://packagist.org/packages/xiaodi/think-pullword)

安装
--

[](#安装)

```
composer require xiaodi/think-pullword

```

使用
--

[](#使用)

#### 常规实例化

[](#常规实例化)

```
use PullWord\PullWord;
class Index
{
    public function index()
    {
        $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        $pullWord = new PullWord($source);
        $result = $pullWord->pull()->toJson()->get();
        // $result = $pullWord->service('pull', $source)->get();
        // 结果 => string(169) "[{"t":"352净水器"},{"t":"净水器"},{"t":"家用"},{"t":"大通量"},{"t":"1000g"},{"t":"反渗透"},{"t":"反渗透纯水机"},{"t":"渗透"},{"t":"纯水机"}]

        // 商品分类
        // $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        // $pullWord = new PullWord($source);
        // $result = $pullWord->classify()->get();
        // // $result = $pullWord->service('classify', $source)->get();
        // 结果 => string(27) "{"class":"电器","idx":11}"
    }
}
```

#### 依赖注入

[](#依赖注入)

```
use PullWord\PullWord;
class Index
{
    public function index(PullWord $pullWord)
    {
        $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        $result = $pullWord->pull($source)->get();
        var_dump($result);

        // $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        // $result = $pullWord->classify($source)->get();
        // var_dump($result);
    }
}
```

#### 门面

[](#门面)

```
use PullWord\Facade\PullWord;

class Index
{
    public function index()
    {
        $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        $result = PullWord::pull($source')->get();
        var_dump($result);
    }
}
```

#### 助手函数

[](#助手函数)

```
class Index
{
    public function index()
    {
        $source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
        $result = app('pullword')->pull($source)->get();
        var_dump($result);
    }
}
```

### 其它链式方法

[](#其它链式方法)

#### json返回

[](#json返回)

```
$source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
PullWord::pull($source)->toJson()->get();
// 结果 [{"t":"352净水器","p":"1"},{"t":"净水器","p":"1"},{"t":"家用","p":"1"},{"t":"大通量","p":"0.923331"},{"t":"1000g","p":"0.959741"},{"t":"反渗透","p":"0.944082"},{"t":"反渗透纯水机","p":"0.964588"},{"t":"渗透","p":"0.838643"},{"t":"纯水机","p":"0.928798"}]
```

#### 调试模式

[](#调试模式)

结果含有出词概率

```
$source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
PullWord::pull($source)->debug()->get();
// 结果 [{"t":"352净水器","p":"1"},{"t":"净水器","p":"1"},{"t":"家用","p":"1"},{"t":"大通量","p":"0.923331"},{"t":"1000g","p":"0.959741"},{"t":"反渗透","p":"0.944082"},{"t":"反渗透纯水机","p":"0.964588"},{"t":"渗透","p":"0.838643"},{"t":"纯水机","p":"0.928798"}]
```

#### 设置阈值

[](#设置阈值)

出词概率阈值(0-1之间的小数)，1表示只有100%有把握的词才出

```
$source = '352净水器K10家用直饮大通量1000G 厨下RO反渗透纯水机';
PullWord::pull($source)->threshold(0.4)->toJson()->get();
// 结果 [{"t":"352"},{"t":"352净水器"},{"t":"净水"},{"t":"净水器"},{"t":"家用"},{"t":"大通量"},{"t":"通量"},{"t":"1000g"},{"t":"反渗透"},{"t":"反渗透纯水机"},{"t":"渗透"},{"t":"纯水"},{"t":"纯水机"},{"t":"水机"}]
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~144 days

Total

4

Last Release

1959d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81fb8c1760e123896567a7795983521f3f6c46a2c041613a176f83603e5e52e9?d=identicon)[xiaodi](/maintainers/xiaodi)

---

Top Contributors

[![edenleung](https://avatars.githubusercontent.com/u/31346973?v=4)](https://github.com/edenleung "edenleung (13 commits)")

---

Tags

phppullwordthinkphpphpthinkphpthink-extend

### Embed Badge

![Health badge](/badges/xiaodi-think-pullword/health.svg)

```
[![Health](https://phpackages.com/badges/xiaodi-think-pullword/health.svg)](https://phpackages.com/packages/xiaodi-think-pullword)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)

PHPackages © 2026

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