vincent-coetzee / PorterStemmer

The Porter stemming algorithm is a process for removing the more common morphological and inflexional endings from words in English. A Swift wrapper around Martin Porter's algorithm.
2 stars 1 forks source link

PorterStemmer

This library wraps the original Porter Stemming Algorithm implementation from Martin Porter, and makes it available as a Swift package.

For more information on the Porter Stemming Algorithm please refer to

https://www.tartarus.org/~martin/PorterStemmer

The package is very simple to use, import version 1.0.0 of the package in your Swift Package file, and then import PorterStemmer.

To use the stemmer in your code, create an instance of the PorterStemmer class, and ask it to stem the word.

import PorterStemmer

if let stemmer = PorterStemmer()
    {
    let inputWord = "convenience"
    let stemmedWord = stemmer.stem(inputWord)
    print(stemmedWord)
    }

The implementation has been succesfully tested using the sample words generated by Martin Porter. This framwork has been tested on both Linux and macOS.