Class Utility
java.lang.Object
org.apache.lucene.analysis.cn.smart.Utility
SmartChineseAnalyzer utility constants and methods
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]Delimiters will be filtered to this character bySegTokenFilterstatic final char[]static final intMaximum bigram frequency (used in the smoothing function).static final char[]static final StringSpace-like characters that need to be skipped: such as space, tab, newline, carriage return.static final char[]static final char[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareArray(char[] larray, int lstartIndex, char[] rarray, int rstartIndex) compare two arrays starting at the specified offsets.static intcompareArrayByPrefix(char[] shortArray, int shortIndex, char[] longArray, int longIndex) Compare two arrays, starting at the specified offsets, but treating shortArray as a prefix to longArray.static intgetCharType(char ch) Return the internalCharTypeconstant of a given character.
-
Field Details
-
STRING_CHAR_ARRAY
public static final char[] STRING_CHAR_ARRAY -
NUMBER_CHAR_ARRAY
public static final char[] NUMBER_CHAR_ARRAY -
START_CHAR_ARRAY
public static final char[] START_CHAR_ARRAY -
END_CHAR_ARRAY
public static final char[] END_CHAR_ARRAY -
COMMON_DELIMITER
public static final char[] COMMON_DELIMITERDelimiters will be filtered to this character bySegTokenFilter -
SPACES
Space-like characters that need to be skipped: such as space, tab, newline, carriage return.- See Also:
-
MAX_FREQUENCE
public static final int MAX_FREQUENCEMaximum bigram frequency (used in the smoothing function).- See Also:
-
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
compareArray
public static int compareArray(char[] larray, int lstartIndex, char[] rarray, int rstartIndex) compare two arrays starting at the specified offsets.- Parameters:
larray- left arraylstartIndex- start offset into larrayrarray- right arrayrstartIndex- start offset into rarray- Returns:
- 0 if the arrays are equal,1 if larray > rarray, -1 if larray < rarray
-
compareArrayByPrefix
public static int compareArrayByPrefix(char[] shortArray, int shortIndex, char[] longArray, int longIndex) Compare two arrays, starting at the specified offsets, but treating shortArray as a prefix to longArray. As long as shortArray is a prefix of longArray, return 0. Otherwise, behave ascompareArray(char[], int, char[], int)- Parameters:
shortArray- prefix arrayshortIndex- offset into shortArraylongArray- long array (word)longIndex- offset into longArray- Returns:
- 0 if shortArray is a prefix of longArray, otherwise act as
compareArray(char[], int, char[], int)
-
getCharType
public static int getCharType(char ch) Return the internalCharTypeconstant of a given character.- Parameters:
ch- input character- Returns:
- constant from
CharTypedescribing the character type. - See Also:
-