Class StemmerUtil


  • public class StemmerUtil
    extends Object
    Some commonly-used stemming functions
    • Constructor Summary

      Constructors 
      Constructor Description
      StemmerUtil()  
    • Constructor Detail

      • StemmerUtil

        public StemmerUtil()
    • Method Detail

      • startsWith

        public static boolean startsWith​(char[] s,
                                         int len,
                                         String prefix)
        Returns true if the character array starts with the suffix.
        Parameters:
        s - Input Buffer
        len - length of input buffer
        prefix - Prefix string to test
        Returns:
        true if s starts with prefix
      • endsWith

        public static boolean endsWith​(char[] s,
                                       int len,
                                       String suffix)
        Returns true if the character array ends with the suffix.
        Parameters:
        s - Input Buffer
        len - length of input buffer
        suffix - Suffix string to test
        Returns:
        true if s ends with suffix
      • endsWith

        public static boolean endsWith​(char[] s,
                                       int len,
                                       char[] suffix)
        Returns true if the character array ends with the suffix.
        Parameters:
        s - Input Buffer
        len - length of input buffer
        suffix - Suffix string to test
        Returns:
        true if s ends with suffix
      • delete

        public static int delete​(char[] s,
                                 int pos,
                                 int len)
        Delete a character in-place
        Parameters:
        s - Input Buffer
        pos - Position of character to delete
        len - length of input buffer
        Returns:
        length of input buffer after deletion
      • deleteN

        public static int deleteN​(char[] s,
                                  int pos,
                                  int len,
                                  int nChars)
        Delete n characters in-place
        Parameters:
        s - Input Buffer
        pos - Position of character to delete
        len - Length of input buffer
        nChars - number of characters to delete
        Returns:
        length of input buffer after deletion