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: Check if b[: k + 1] ends with `s`.
  
  Parameters
  ----------
  s : str
  
  Returns
  -------
  bool
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.parsing.porter import PorterStemmer
      >>> p = PorterStemmer()
      >>> p.b = "cowboy"
      >>> p.j = 5
      >>> p.k = 2
      >>> p._ends("cow")
      True
docstr_tok: ["Check","if","b","[",":","k","+","1","]","ends","with","`","s","`",".","Parameters","--","--","--","--","--","s",":","str","Returns","--","--","--","-","bool","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.parsing.porter","import","PorterStemmer",">",">",">","p","=","PorterStemmer","(",")",">",">",">","p.b","=","``","cowboy","''",">",">",">","p.j","=","5",">",">",">","p.k","=","2",">",">",">","p._ends","(","``","cow","''",")","True"]
code: def _ends(self, s):
      """Check if b[: k + 1] ends with `s`.
  
      Parameters
      ----------
      s : str
  
      Returns
      -------
      bool
  
      Examples
      --------
      .. sourcecode:: pycon
  
          >>> from gensim.parsing.porter import PorterStemmer
          >>> p = PorterStemmer()
          >>> p.b = "cowboy"
          >>> p.j = 5
          >>> p.k = 2
          >>> p._ends("cow")
          True
  
      """
      if s[-1] != self.b[self.k]:  # tiny speed-up
          return False
      length = len(s)
      if length > (self.k + 1):
          return False
      if self.b[self.k - length + 1 : self.k + 1] != s:
          return False
      self.j = self.k - length
      return True
  
file_path: gensim/gensim/parsing/porter.py
label_desc: Use image node_id 7 for calling the PorterStemmer obj's underlying member method code with example usage: obj._ends(s) and returns: True, False, False, False