markfullmer/porter2
最新稳定版本:1.0
Composer 安装命令:
composer require markfullmer/porter2
包简介
Stem words using the English Porter 2 algorithm
README 文档
README
A PHP library for stemming words using the English Porter 2 algorithm.
Background
A stemmer takes a given word and follows a set of rules to reduce this word to search-index-usable stem (as opposed to the actual word root). For example, aggravate, aggravated, and aggravates all reduce to "aggrav," thus creating a commonality between those words.
Martin Porter's English (Porter 2) Algorithm improves on the original Porter stemmer as described here.
Basic Usage
The included /demo/index.php file contains a conversion form demonstration.
Make your code aware of the Porter2 class via your favorite method (e.g.,
use or require)
Then pass a string of text into the class:
$text = Porter2::stem('consistently'); echo $text; // consist $text = Porter2::stem('consisting'); echo $text; // consist $text = Porter2::stem('consistency'); echo $text; // consist
Stemmer Resources
Tests
A verification list of 29,000 words and their expected stems can be run (after
composer install via phpunit).
统计信息
- 总下载量: 27.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-12
