module documentation

Implementation of Porter Stemming Algorithm from https://tartarus.org/martin/PorterStemmer/python.txt Note: The Python implementation returns different results than the JS version: - Stemming "lay" returns "lai" in Python, but "lay" in JS - Stemming "try" returns "try" in Python, but "tri" in JS Porter Stemming Algorithm This is the Porter stemming algorithm, ported to Python from the version coded up in ANSI C by the author. It may be be regarded as canonical, in that it follows the algorithm presented in Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, no. 3, pp 130-137, only differing from it at the points maked --DEPARTURE-- below. See also http://www.tartarus.org/~martin/PorterStemmer The algorithm as described in the paper could be exactly replicated by adjusting the points of DEPARTURE, but this is barely necessary, because (a) the points of DEPARTURE are definitely improvements, and (b) no encoding of the Porter stemmer I have seen is anything like as exact as this version, even with the points of DEPARTURE! Vivake Gupta (v@nano.com) Release 1: January 2001 Further adjustments by Santiago Bruno (bananabruno@gmail.com) to allow word input not restricted to one word per line, leading to: release 2: July 2008

Class PorterStemmer No class docstring; 0/4 instance variable, 16/16 methods documented
Function stemmer Wrapper around the PorterStemmer for inclusion in pipeline.
Variable porter_stemmer Undocumented
def stemmer(token, i=None, tokens=None): (source)

Wrapper around the PorterStemmer for inclusion in pipeline. Args: language (str): ISO-639-1 code of the language. token (lunr.Token): The token to stem. i (int): The index of the token in a set. tokens (list): A list of tokens representing the set.

porter_stemmer = (source)

Undocumented