'In stem(p,i,j), p is a char pointer, and the string to be stemmed
is from p[i] to p[j] inclusive. Typically i is zero and j is the
offset to the last character of a string, (p[j+1] == \'\'). The
stemmer adjusts the characters p[i] ... p[j] and returns the new
end-point of the string, k. Stemming never increases word length, so
i <= k <= j. To turn the stemmer into a module, declare \'stem\' as
extern, and delete the remainder of this file.'

def stem(self, p, i, j):

    self.b = p
    self.k = j
    self.k0 = i
    if (self.k <= (self.k0 + 1)):
        return self.b
    self.step1ab()
    self.step1c()
    self.step2()
    self.step3()
    self.step4()
    self.step5()
    return self.b[self.k0:(self.k + 1)]
