Description

libstemmer binding for d programming language

Package Information

Version1.0.1 (2016-Mar-24)
Repositoryhttps://github.com/2night/libstemmerd
LicenseMIT License
CopyrightCopyright © 2016, 2night.it
AuthorsAndrea Fontana
Registered byAndrea Fontana
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

libstemmerd

libstemmer binding for d programming language.

How to

import std.stdio;
import stemmer;

void main()
{  
  // Print a list of available languages
  writeln("Available languages: ");
  foreach(stemmer; Stemmer.list)
    writeln(" - ", stemmer);
   
  // Create an english stemmer
  Stemmer s = Stemmer("english");

  // Try it!
  assert(s.stem("testing")   == "test");
  assert(s.stem("test")      == "test");
  assert(s.stem("tested")    == "test");
   
  assert(s.stem("consist")         == "consist");
  assert(s.stem("consisted")       == "consist");
  assert(s.stem("consistency")     == "consist");
  assert(s.stem("consistent")      == "consist");
  assert(s.stem("consistently")    == "consist");
  assert(s.stem("consisting")      == "consist");
  assert(s.stem("consists")        == "consist");

}

Available versions

1.0.1 1.0.0 ~master