Skip to content

Commit 8790e77

Browse files
authored
Update README.md
1 parent 02b0e81 commit 8790e77

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ThinkPHP 分词/抽词 扩展包 `5.1` `6.0`
33

44
[![Latest Stable Version](https://poser.pugx.org/xiaodi/think-pullword/version)](https://packagist.org/packages/xiaodi/think-pullword)
55
[![License](https://poser.pugx.org/xiaodi/think-pullword/license)](https://packagist.org/packages/xiaodi/think-pullword)
6+
67
## 安装
78
```
89
composer require xiaodi/think-pullword:dev-master
@@ -14,12 +15,12 @@ composer require xiaodi/think-pullword:dev-master
1415
use PullWord\PullWord;
1516
class Index
1617
{
17-
public function index( $pullWord)
18+
public function index()
1819
{
1920
$source = '李彦宏是马云最大威胁嘛?';
2021
$pullWord = new PullWord($source);
2122
$result = $pullWord->get();
22-
// result 李彦 李彦宏 彦宏 马云 最大 大威 威胁
23+
// 结果 李彦 李彦宏 彦宏 马云 最大 大威 威胁
2324
}
2425
}
2526
```
@@ -68,21 +69,21 @@ class Index
6869
```
6970

7071
## 其它链式方法
71-
#### 返回json格式
72+
#### json返回
7273
```php
7374
$source = '李彦宏是马云最大威胁嘛?';
7475
PullWord::source($source)->toJson()->get();
7576
// 结果 [{"t":"李彦"},{"t":"李彦宏"},{"t":"彦宏"},{"t":"马云"},{"t":"最大"},{"t":"大威"},{"t":"威胁"}]
7677
```
77-
#### 开启调试模式
78+
#### 调试模式
7879
结果含有出词概率
7980
```php
8081
$source = '李彦宏是马云最大威胁嘛?';
8182
PullWord::source($source)->debug()->get();
8283
// 结果 李彦:0.23007 李彦宏:0.900302 彦宏:0.0703263 马云:1 最大:0.892363 大威:0.289136 威胁:0.9367
8384
```
8485

85-
#### 开启阈值
86+
#### 设置阈值
8687
出词概率阈值(0-1之间的小数),1表示只有100%有把握的词才出
8788
```php
8889
$source = '李彦宏是马云最大威胁嘛?';

0 commit comments

Comments
 (0)