class_docstr: A stemmer for Portuguese.
  
      >>> from nltk.stem import RSLPStemmer
      >>> st = RSLPStemmer()
      >>> # opening lines of Erico Verissimo's "Música ao Longe"
      >>> text = '''
      ... Clarissa risca com giz no quadro-negro a paisagem que os alunos
      ... devem copiar . Uma casinha de porta e janela , em cima duma
      ... coxilha .'''
      >>> for token in text.split(): # doctest: +NORMALIZE_WHITESPACE
      ...     print(st.stem(token))
      clariss risc com giz no quadro-negr a pais que os alun dev copi .
      uma cas de port e janel , em cim dum coxilh .
code: def apply_rule(self, word, rule_index):
      rules = self._model[rule_index]
      for rule in rules:
          suffix_length = len(rule[0])
          if word[-suffix_length:] == rule[0]:  # if suffix matches
              if (
                  len(word) >= suffix_length + rule[1]
              ):  # if we have minimum size
                  if word not in rule[3]:  # if not an exception
                      word = word[:-suffix_length] + rule[2]
                      break
  
      return word
  
file_path: nltk/nltk/stem/rslp.py
imports: from nltk.data import load
  from nltk.stem.api import StemmerI
label_desc: Use image node_id 4 for calling the RSLPStemmer obj's underlying member method code with example usage: obj.apply_rule(word, rule_index) and returns: word