class_docstr: Class contains implementation of Porter stemming algorithm.
  
  Attributes
  --------
  b : str
      Buffer holding a word to be stemmed. The letters are in b[0], b[1] ... ending at b[`k`].
  k : int
      Readjusted downwards as the stemming progresses.
  j : int
      Word length.
class_docstr_tok: ["Class","contains","implementation","of","Porter","stemming","algorithm",".","Attributes","--","--","--","--","b",":","str","Buffer","holding","a","word","to","be","stemmed",".","The","letters","are","in","b","[","0","]",",","b","[","1","]","...","ending","at","b","[","`","k","`","]",".","k",":","int","Readjusted","downwards","as","the","stemming","progresses",".","j",":","int","Word","length","."]
docstr: Stem the word `w`.
  
  Parameters
  ----------
  w : str
  
  Returns
  -------
  str
      Stemmed version of `w`.
  
  Examples
  --------
  
  .. sourcecode:: pycon
  
      >>> from gensim.parsing.porter import PorterStemmer
      >>> p = PorterStemmer()
      >>> p.stem("ponies")
      'poni'
docstr_tok: ["Stem","the","word","`","w","`",".","Parameters","--","--","--","--","--","w",":","str","Returns","--","--","--","-","str","Stemmed","version","of","`","w","`",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.parsing.porter","import","PorterStemmer",">",">",">","p","=","PorterStemmer","(",")",">",">",">","p.stem","(","``","ponies","''",")","'poni","'"]
code: def stem(self, w):
      """Stem the word `w`.
  
      Parameters
      ----------
      w : str
  
      Returns
      -------
      str
          Stemmed version of `w`.
  
      Examples
      --------
  
      .. sourcecode:: pycon
  
          >>> from gensim.parsing.porter import PorterStemmer
          >>> p = PorterStemmer()
          >>> p.stem("ponies")
          'poni'
  
      """
      w = w.lower()
      k = len(w) - 1
      if k <= 1:
          return w  # --DEPARTURE--
  
      # With this line, strings of length 1 or 2 don't go through the
      # stemming process, although no mention is made of this in the
      # published algorithm. Remove the line to match the published
      # algorithm.
  
      self.b = w
      self.k = k
  
      self._step1ab()
      self._step1c()
      self._step2()
      self._step3()
      self._step4()
      self._step5()
      return self.b[: self.k + 1]
  
file_path: gensim/gensim/parsing/porter.py
label_desc: Use image node_id 16 for calling the PorterStemmer obj's underlying member method code with example usage: obj.stem(w) and returns: self, w