Package org.apache.lucene.analysis.pt

# Class RSLPStemmerBase.Rule

java.lang.Object
org.apache.lucene.analysis.pt.RSLPStemmerBase.Rule

Direct Known Subclasses:
  `RSLPStemmerBase.RuleWithSetExceptions`, `RSLPStemmerBase.RuleWithSuffixExceptions`

Enclosing class:
  `RSLPStemmerBase`

protected static class RSLPStemmerBase.Rule extends Object
A basic rule, with no exceptions.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final int`
  `min`
  `protected final char[]`
  `replacement`
  `protected final char[]`
  `suffix`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Rule(String suffix, int min, String replacement)`
  Create a rule.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `matches(char[] s, int len)`
  `int`
  `replace(char[] s, int len)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### suffix

    protected final char[] suffix

  - ### replacement

    protected final char[] replacement

  - ### min

    protected final int min

- ## Constructor Details

  - ### Rule

    public Rule(String suffix, int min, String replacement)
    Create a rule.
    Parameters:
      `suffix` - suffix to remove
      `min` - minimum stem length
      `replacement` - replacement string

- ## Method Details

  - ### matches

    public boolean matches(char[] s, int len)
    Returns:
      true if the word matches this rule.

  - ### replace

    public int replace(char[] s, int len)
    Returns:
      new valid length of the string after firing this rule.