PHPackages                             hallelujahbaby/scws - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hallelujahbaby/scws

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hallelujahbaby/scws
===================

简易中文分词系统在Laravel的封装包。

1.0.3(7y ago)1261MITPHPPHP &gt;=5.5.9

Since May 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/JT501/SCWS)[ Packagist](https://packagist.org/packages/hallelujahbaby/scws)[ Docs](https://github.com/Latrell/SCWS)[ RSS](/packages/hallelujahbaby-scws/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (5)Used By (1)

SCWS
====

[](#scws)

該項目封裝 [簡易中文分詞系統](https://github.com/hightman/scws) 為 Laravel 拓展包。

**注意: 本項目不包含SCWS PHP 擴展, 你需要先自行安裝才能使用SCWS的分詞功能。**

[官方安裝說明](http://www.xunsearch.com/scws/docs.php#instscws) | [轉載別人的安裝教學](https://www.jianshu.com/p/c1dbad3a3630)

安裝
--

[](#安裝)

```
composer require JT501/scws

```

更新你的依賴包 `composer update` 或者全新安裝 `composer install`。

使用
--

[](#使用)

如你在使用 Laravel 5.5 以下版本，你必須自己註冊服務提供者到Laravel服務提供者列表中。

打開配置文件 `config/app.php`。

找到key為 `providers` 的數組，在數組中添加服務提供者。

```
    'providers' => [
        // ...
        Latrell\Scws\ScwsServiceProvider::class,
    ]
```

找到key為 `aliases` 的數組，在數組中註冊Facades。

```
    'aliases' => [
        // ...
        'Scws' => Latrell\Scws\Facades\Scws::class,
    ]
```

發怖配置文件到你的項目內。

```
php artisan vendor:publish --provider="Latrell\Scws\ScwsServiceProvider"
```

發怖成功後會在`Config`產生`latrell-scws.php`, 你可以在內更改配置。

```
