Skip to content
/ stemmer Public

An English (Porter2) stemming implementation in Elixir.

Notifications You must be signed in to change notification settings

fredwu/stemmer

Repository files navigation

Stemmer Travis Coverage Hex.pm

An English (Porter2) stemming implementation in Elixir.

In linguistic morphology and information retrieval, stemming is the process of reducing inflected (or sometimes derived) words to their word stem, base or root form—generally a written word form. The stem need not be identical to the morphological root of the word; it is usually sufficient that related words map to the same stem, even if this stem is not in itself a valid root. - Wikipedia

Usage

The Stemmer.stem/1 function supports stemming a single word (String), a sentence (String) or a list of single words (List of Strings).

Stemmer.stem("capabilities")                    # => "capabl"
Stemmer.stem("extraordinary capabilities")      # => "extraordinari capabl"
Stemmer.stem(["extraordinary", "capabilities"]) # => ["extraordinari", "capabl"]

Compatibility

Stemmer is 100% compatible with the official Porter2 implementation, it is tested against the official diffs.txt which contains more than 29000 words.

Naive Bayes

Stemmer was built to support the Simple Bayes library. ❤️

License

Licensed under MIT.

About

An English (Porter2) stemming implementation in Elixir.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages