class_docstr: A word stemmer based on the Porter stemming algorithm.
  
      Porter, M. "An algorithm for suffix stripping."
      Program 14.3 (1980): 130-137.
  
  See https://www.tartarus.org/~martin/PorterStemmer/ for the homepage
  of the algorithm.
  
  Martin Porter has endorsed several modifications to the Porter
  algorithm since writing his original paper, and those extensions are
  included in the implementations on his website. Additionally, others
  have proposed further improvements to the algorithm, including NLTK
  contributors. There are thus three modes that can be selected by
  passing the appropriate constant to the class constructor's `mode`
  attribute:
  
  - PorterStemmer.ORIGINAL_ALGORITHM
  
      An implementation that is faithful to the original paper.
  
      Note that Martin Porter has deprecated this version of the
      algorithm. Martin distributes implementations of the Porter
      Stemmer in many languages, hosted at:
  
      https://www.tartarus.org/~martin/PorterStemmer/
  
      and all of these implementations include his extensions. He
      strongly recommends against using the original, published
      version of the algorithm; only use this mode if you clearly
      understand why you are choosing to do so.
  
  - PorterStemmer.MARTIN_EXTENSIONS
  
      An implementation that only uses the modifications to the
      algorithm that are included in the implementations on Martin
      Porter's website. He has declared Porter frozen, so the
      behaviour of those implementations should never change.
  
  - PorterStemmer.NLTK_EXTENSIONS (default)
  
      An implementation that includes further improvements devised by
      NLTK contributors or taken from other modified implementations
      found on the web.
  
  For the best stemming, you should use the default NLTK_EXTENSIONS
  version. However, if you need to get the same results as either the
  original algorithm or one of Martin Porter's hosted versions for
  compatibility with an existing implementation or dataset, you can use
  one of the other modes instead.
class_docstr_tok: ["A","word","stemmer","based","on","the","Porter","stemming","algorithm",".","Porter",",","M.","``","An","algorithm","for","suffix","stripping",".","''","Program","14.3","(","1980",")",":","130-137",".","See","https",":","\/\/www.tartarus.org\/~martin\/PorterStemmer\/","for","the","homepage","of","the","algorithm",".","Martin","Porter","has","endorsed","several","modifications","to","the","Porter","algorithm","since","writing","his","original","paper",",","and","those","extensions","are","included","in","the","implementations","on","his","website",".","Additionally",",","others","have","proposed","further","improvements","to","the","algorithm",",","including","NLTK","contributors",".","There","are","thus","three","modes","that","can","be","selected","by","passing","the","appropriate","constant","to","the","class","constructor","'s","`","mode","`","attribute",":","-","PorterStemmer.ORIGINAL_ALGORITHM","An","implementation","that","is","faithful","to","the","original","paper",".","Note","that","Martin","Porter","has","deprecated","this","version","of","the","algorithm",".","Martin","distributes","implementations","of","the","Porter","Stemmer","in","many","languages",",","hosted","at",":","https",":","\/\/www.tartarus.org\/~martin\/PorterStemmer\/","and","all","of","these","implementations","include","his","extensions",".","He","strongly","recommends","against","using","the","original",",","published","version","of","the","algorithm",";","only","use","this","mode","if","you","clearly","understand","why","you","are","choosing","to","do","so",".","-","PorterStemmer.MARTIN_EXTENSIONS","An","implementation","that","only","uses","the","modifications","to","the","algorithm","that","are","included","in","the","implementations","on","Martin","Porter","'s","website",".","He","has","declared","Porter","frozen",",","so","the","behaviour","of","those","implementations","should","never","change",".","-","PorterStemmer.NLTK_EXTENSIONS","(","default",")","An","implementation","that","includes","further","improvements","devised","by","NLTK","contributors","or","taken","from","other","modified","implementations","found","on","the","web",".","For","the","best","stemming",",","you","should","use","the","default","NLTK_EXTENSIONS","version",".","However",",","if","you","need","to","get","the","same","results","as","either","the","original","algorithm","or","one","of","Martin","Porter","'s","hosted","versions","for","compatibility","with","an","existing","implementation","or","dataset",",","you","can","use","one","of","the","other","modes","instead","."]
docstr: Implements Step 1a from "An algorithm for suffix stripping"
  
  From the paper:
  
      SSES -> SS                         caresses  ->  caress
      IES  -> I                          ponies    ->  poni
                                         ties      ->  ti
      SS   -> SS                         caress    ->  caress
      S    ->                            cats      ->  cat
docstr_tok: ["Implements","Step","1a","from","``","An","algorithm","for","suffix","stripping","''","From","the","paper",":","SSES","-",">","SS","caresses","-",">","caress","IES","-",">","I","ponies","-",">","poni","ties","-",">","ti","SS","-",">","SS","caress","-",">","caress","S","-",">","cats","-",">","cat"]
code: def _step1a(self, word):
      """Implements Step 1a from "An algorithm for suffix stripping"
  
      From the paper:
  
          SSES -> SS                         caresses  ->  caress
          IES  -> I                          ponies    ->  poni
                                             ties      ->  ti
          SS   -> SS                         caress    ->  caress
          S    ->                            cats      ->  cat
      """
      # this NLTK-only rule extends the original algorithm, so
      # that 'flies'->'fli' but 'dies'->'die' etc
      if self.mode == self.NLTK_EXTENSIONS:
          if word.endswith("ies") and len(word) == 4:
              return self._replace_suffix(word, "ies", "ie")
  
      return self._apply_rule_list(
          word,
          [
              ("sses", "ss", None),  # SSES -> SS
              ("ies", "i", None),  # IES  -> I
              ("ss", "ss", None),  # SS   -> SS
              ("s", "", None),  # S    ->
          ],
      )
  
imports: import re
  from nltk.stem.api import StemmerI
label_desc: Use image node_id 10 for calling the PorterStemmer obj's underlying member method code with example usage: obj._step1a(word) and returns: self, self