masroore/stopwords
最新稳定版本:1.0.2
Composer 安装命令:
composer require masroore/stopwords
包简介
A PHP package to remove common stopwords from an input text, it covers most languages.
关键字:
README 文档
README
Overview
Stopwords in multiple languages that you can easily use with your PHP applications.
Supported languages
Currently provides stopwords for the following languages:
- Arabic
- Azerbaijani
- Bengali
- Danish
- Dutch
- English
- Finnish
- French
- German
- Greek
- Hungarian
- Indonesian
- Italian
- Kazakh
- Nepali
- Norwegian
- Portuguese
- Romanian
- Russian
- Slovene
- Spanish
- Swedish
- Tajik
- Turkish
Installation
Requires PHP 8.0+
You can install the package via composer:
composer require masroore/stopwords
Usage
$stopwords = new Kaiju\Stopwords\Stopwords(); // get the list of available languages print_r($stopwords->getLanguages()); // load stopwords for a language $stopwords->load('english'); // load stopwords for multiple languages $stopwords->load(['english', 'french']); // load stopwords for all available languages $stopwords->load('*'); // check if the given word is a stop-word $stopwords->isStopword('the'); // TRUE $stopwords->isStopword('America'); // FALSE // return a tokenized copy of the text, with stop-words and punctuation marks removed $text = "Good muffins cost $3.88\nin New York. Please buy me two of them.\n\nThanks!\n"; print_r($stopwords->strip($text)); // ["Good","muffins","cost","$3.88","New","York","Please","buy","two","Thanks"] echo $stopwords->clean($text); // "Good muffins cost $3.88 New York Please buy two Thanks"
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Thank you for considering to contribute to Collision. All the contribution guidelines are mentioned here.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
Collision is an open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 4.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-12