Package org.apache.lucene.analysis.util
Class StemmerUtil
java.lang.Object
org.apache.lucene.analysis.util.StemmerUtil
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
Modifier and TypeMethodDescriptionstatic 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 booleanReturns 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 Details
-
startsWith
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
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
-