nouralhadi/stemmer
Composer 安装命令:
composer require nouralhadi/stemmer
包简介
The first free open source Arabic stemmer ever written in PHP for Laravel framework implementing ISRI algorithm
README 文档
README
The first free and open source Arabic stemmer ever written in PHP for Laravel framework implementing ISRI algorithm.
Due to lack of support for Arabic language despite its wonderful features and grammar, and as an Arabian open source tech geek in love with technologies, I felt like it's my duty to help my native language to rise, and help making Arab programmers life a bit easier.
This package contains the ISRI Stemming class build from scratch by myself and willing to make this project for global PHP use (not restricted to Laravel) next step will be Symfony 😍 .
Please note that this is just the beginning, and I'm willing to continue building a project that will serve the whole Arab language.
Install
You can install this package using composer:
composer require nouralhadi/stemmer
For Laravel < 5.5, You should add the package to your service providers array in config/app.php:
\Nouralhadi\Stemmer\StemmerServiceProvider::class,
How to use
You can visit this route /stemmer after installing this package to access the testing page of the package.
The only feature it contains (for now) is the stem feature, which accepts an arabic word and return its root.
You can use the Stemmer class by Injecting it inside your caller function / controller:
use Nouralhadi\Stemmer\Http\Helpers\ISRIStemmer;
public function test(ISRIStemmer $stemmer){
$string = 'وزراء';
echo $stemmer->stem($string);
// Resulting: وزر
}
Or you can stem a complete sentence by splitting into words and steam each:
use Nouralhadi\Stemmer\Http\Helpers\ISRIStemmer;
public function test(ISRIStemmer $stemmer){
$string = 'كتب المستخدم رسالة إلى مدير الموقع';
$words = mb_split(' ',$string);
$ret = [];
foreach ($words as $word){
array_push($ret, $this->Stemmer->stem($word));
}
$result = implode(' ', $ret);
// Resulting: كتب خدم رسل ألى دير وقع
}
Contribute
Anyone willing to contribute to this project is welcomed, any help of any kind will be appreciated, and if you're ready to help then please reach out to my personal email nouralhadi99@gmail.com.
License
This Project is an open-sourced software licensed under the GPLv3 License.
nouralhadi/stemmer 适用场景与选型建议
nouralhadi/stemmer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 171 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nouralhadi/stemmer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nouralhadi/stemmer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 171
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-05-16