An English (Porter2) stemming implementation in Elixir.
Elixir
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config Initial commit Jul 17, 2016
lib More micro performance optimisations Jul 28, 2016
test Fixed the last edge case, 100% compatibility achieved! Jul 19, 2016
.gitignore Added official `diffs.txt` for testing Jul 19, 2016
.travis.yml
README.md
mix.exs Added auto git pushing upon releases Jul 29, 2017
mix.lock

README.md

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.