wdmg/lingua-stem

Implementation of the Porter Stemmer algorithm with support English, Russian and Ukrainian locales.

1.0.1 2020-05-06 23:22 UTC

This package is auto-updated.

Last update: 2021-12-07 02:54:29 UTC


README

Downloads Packagist Version Progress GitHub license

LinguaStem

Implementation of the Porter Stemmer algorithm with support English, Russian and Ukrainian locales. Based on PorterStemmer class [https://tartarus.org/martin/PorterStemmer/php.txt] and [http://snowball.tartarus.org/algorithms/russian/stemmer.html]

Requirements

  • PHP 5.6 or higher

Installation

To install the library, run the following command in the console:

$ composer require "wdmg/lingua-stem"

Usage

<?php

    $word = 'landmarks';
    $stem = new LinguaStem('en');
    print $stem::word($word);
    
    // or
    
    $text = 'Chicago has many historic places to visit. Keith found the Chicago Water Tower impressive as it is one of the few remaining landmarks to have survived the Great Chicago Fire of 1871.';
    $stem = new LinguaStem('en');
    print $stem->text($text);

?>

Common Information

http://snowball.tartarus.org/algorithms/porter/stemmer.html https://metacpan.org/release/Lingua-Stem https://en.wikipedia.org/wiki/Stemming https://ru.wikipedia.org/wiki/Стеммер_Портера

Status and version [ready to use]

  • v.1.0.1 - Added namespace
  • v.1.0.0 - Added LinguaStem() class code and library of patterns

Copyrights