Class RSLPStemmerBase.Rule

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int min  
      protected char[] replacement  
      protected char[] suffix  
    • Constructor Summary

      Constructors 
      Constructor Description
      Rule​(java.lang.String suffix, int min, java.lang.String replacement)
      Create a rule.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • suffix

        protected final char[] suffix
      • replacement

        protected final char[] replacement
      • min

        protected final int min
    • Constructor Detail

      • Rule

        public Rule​(java.lang.String suffix,
                    int min,
                    java.lang.String replacement)
        Create a rule.
        Parameters:
        suffix - suffix to remove
        min - minimum stem length
        replacement - replacement string
    • Method Detail

      • 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.