承接 wamania/php-stemmer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wamania/php-stemmer

最新稳定版本:v4.0.0

Composer 安装命令:

composer require wamania/php-stemmer

包简介

Native PHP Stemmer

README 文档

README

PHP native implementation of Snowball stemmer https://snowballstem.org/

Accept only UTF-8

Languages

Available :

  • Catalan (by Orestes Sanchez Benavente orestes@estotienearreglo.es)
  • Danish
  • Dutch
  • English
  • Finnish (by Mikko Saari)
  • French
  • German
  • Italian
  • Norwegian
  • Portuguese
  • Romanian
  • Russian
  • Spanish
  • Swedish

Installation

For PHP5, use 1.3

composer require wamania/php-stemmer "^1.3"

For PHP7 use 2.x (branch 2.x is backward compatible with 1.x)

composer require wamania/php-stemmer "^2.0"

For PHP^7.3 and PHP^8.0 use 3.x (backward compatible, but phpunit^9 don't work with php < 7.3)

composer require wamania/php-stemmer "^3.0"

For PHP^8.4 use 4.x (avoid deprecated by switching from voku utf8 to joomla/string )

composer require wamania/php-stemmer "^4.0"

Usage

For 2.x ~ 4.x, you should use the factory

use Wamania\Snowball\StemmerFactory;

// use ISO_639 (2 or 3 letters) or language name in english
$stemmer = StemmerFactory::create('fr');
$stemmer = StemmerFactory::create ('spanish');

// then 
$stem = $stemmer->stem('automóvil');

Or the manager

use Wamania\Snowball\StemmerManager;

$manager = new StemmerManager();
$stem = $manager->stem('automóvil', 'es');

In 1.3, you must instantiate manually

use Wamania\Snowball\French;

$stemmer = new French();
$stem = $stemmer->stem('anticonstitutionnellement');

统计信息

  • 总下载量: 3.64M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 145
  • 点击次数: 2
  • 依赖项目数: 32
  • 推荐数: 3

GitHub 信息

  • Stars: 142
  • Watchers: 12
  • Forks: 35
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04