Git Product home page Git Product logo

php-stemmer's Introduction

php-stemmer

This stem extension for PHP provides stemming capability for a variety of languages using Dr. M.F. Porter's Snowball API.

It has a much simpler API than the stem extension found in pecl.

What's new in this fork:

  • Added support for PHP7.
  • Dropped functionality: stemword only takes a string (no arrays allowed).

Usage Example

<?php
    echo stemword('cats', 'english', 'UTF_8');      # cat
    echo stemword('stemming', 'english', 'UTF_8');  # stem
?>

Install

The stemmer PHP extension can be installed following the instructions about building PHP extensions using phpize as described in the PHP manual.

To build this extension, you need to have the PHP development tools installed. For ubuntu/debian you can use apt-get install php5-dev.

The phpize command is used to prepare the build environment for a PHP extension.

In the following sample, the sources for an extension are in a directory named stemmer-php:

 # git clone https://github.com/manuel-colmenero/php-stemmer.git
 # cd php-stemmer
 # phpize
 # ./configure
 # make -C libstemmer_c
 # make
 # [sudo] make install

Edit you php.ini file and add the line extension=stemmer.so

About libstemmer_c

The stemmer PHP extension uses a modified version of libstemmer_c.

It has replaced the default Dutch stemming algorithm with the much better Kraaij-Pohlmann Dutch stemming algorithm. The modified version of this lib can be downloaded from mysqludf.com.

Original Source

This version is a fork from Harold Thétiot's and the main purpose was to make it PHP7 compatible.

Harold's version is a fork of php-stemmer hosted on Google Code orinaly made by Javeline B.V and available here: http://code.google.com/p/php-stemmer/

Licence

New BSD License

See License file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.