Download the PHP package nxp/russian-porter-stemmer without Composer
On this page you can find all versions of the php package nxp/russian-porter-stemmer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nxp/russian-porter-stemmer
More information about nxp/russian-porter-stemmer
Files in nxp/russian-porter-stemmer
Download nxp/russian-porter-stemmer
More information about nxp/russian-porter-stemmer
Files in nxp/russian-porter-stemmer
Vendor nxp
Package russian-porter-stemmer
Short Description Russian porter stemmer
License GPL-3.0+
Homepage http://github.com/NeonXP/Stemmer
Package russian-porter-stemmer
Short Description Russian porter stemmer
License GPL-3.0+
Homepage http://github.com/NeonXP/Stemmer
Please rate this library. Is it a good library?
Informations about the package russian-porter-stemmer
Стеммер Портера для русского языка
Описание
Данный стеммер является заменой расширению stem_russian_unicode.
Сравнение с расширением stem_russian_unicode
Плюсы:
- Не требует внешних расширений для PHP. Стеммер написан целиком на PHP.
- Нет проблем с юникодом. stem_russian_unicode зависит от SET_LOCALE и может при неверном значении портить строки с юникодом.
- Легко изменять под конкретные требования проекта. В случае расширения, при изменении логики работы его придётся пересобирать.
- Требует для своей работы PHP версии >=5.3 (спасибо, usernam3 за pull-request)
Минусы:
В силу того, что этот стеммер написан на PHP с использованием регулярных выражений, он должен проигрывать в скорости работы скомпилированному расширению, написанному на C.
Установка
php composer.phar require nxp/russian-porter-stemmer
Использование
<?php
$text = '...';
require __DIR__ . '/vendor/autoload.php';
$stemmer = new \NXP\Stemmer();
$stemmed = [];
foreach (explode(' ', $text) as $word) {
$stemmed[] = $stemmer->getWordBase($word);
}
$result = implode(' ', $stemmed);
Отличия от классического стеммера Портера
Единственное отличие заключается в том, что в данной реализации буква «ё» является самостоятельной гласной, а не буквой «е»
Лицензия MIT
All versions of russian-porter-stemmer with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.3
The package nxp/russian-porter-stemmer contains the following files
Loading the files please wait ....