Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 888 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 888 Bytes

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.