Package org.apache.lucene.analysis.util
Class StemmerUtil
- java.lang.Object
-
- org.apache.lucene.analysis.util.StemmerUtil
-
public class StemmerUtil extends Object
Some commonly-used stemming functions- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdelete(char[] s, int pos, int len)Delete a character in-placestatic intdeleteN(char[] s, int pos, int len, int nChars)Delete n characters in-placestatic booleanendsWith(char[] s, int len, char[] suffix)Returns true if the character array ends with the suffix.static booleanendsWith(char[] s, int len, String suffix)Returns true if the character array ends with the suffix.static booleanstartsWith(char[] s, int len, String prefix)Returns true if the character array starts with the suffix.
-
-
-
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 Bufferlen- length of input bufferprefix- Prefix string to test- Returns:
- true if
sstarts withprefix
-
endsWith
public static boolean endsWith(char[] s, int len, String suffix)Returns true if the character array ends with the suffix.- Parameters:
s- Input Bufferlen- length of input buffersuffix- Suffix string to test- Returns:
- true if
sends withsuffix
-
endsWith
public static boolean endsWith(char[] s, int len, char[] suffix)Returns true if the character array ends with the suffix.- Parameters:
s- Input Bufferlen- length of input buffersuffix- Suffix string to test- Returns:
- true if
sends withsuffix
-
delete
public static int delete(char[] s, int pos, int len)Delete a character in-place- Parameters:
s- Input Bufferpos- Position of character to deletelen- 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 Bufferpos- Position of character to deletelen- Length of input buffernChars- number of characters to delete- Returns:
- length of input buffer after deletion
-
-