Interface SMStringNGram
-
- All Superinterfaces:
SimilarityMeasure,SMString
- All Known Implementing Classes:
SMStringNGramImpl
public interface SMStringNGram extends SMString
Measures the nGram similarity of two strings. Splits both strings into all possible substrings of length n and computes a distance based on the number of identical sub-strings. The distance is normalized by division through the number of the maximum nGrams of both substrings. The comparison can be case sensitive or insensitive. For further explanation refer to the wiki.- Author:
- Alexander Schultheis
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_CASE_SENSITIVEThe default value for case sensitive is true.static intDEFAULT_NThe default n value is 1.static StringNAMEName of similarity measure is "StringNGram".-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
COMPONENT, COMPONENT_KEY, LOG_ORDER_NAME_NOT_FOUND
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetN()Gets the value of n-booleanisCaseInsensitive()Gets boolean value, whether case is insensitive.booleanisCaseSensitive()Gets boolean value, whether case is sensitive.voidsetCaseInsensitive()Sets case to insensitive.voidsetCaseSensitive()Sets case to sensitive.voidsetN(int n)Sets the value for n.-
Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
-
-
-
-
Field Detail
-
NAME
static final String NAME
Name of similarity measure is "StringNGram".- See Also:
- Constant Field Values
-
DEFAULT_N
static final int DEFAULT_N
The default n value is 1.- See Also:
- Constant Field Values
-
DEFAULT_CASE_SENSITIVE
static final boolean DEFAULT_CASE_SENSITIVE
The default value for case sensitive is true.- See Also:
- Constant Field Values
-
-
Method Detail
-
getN
int getN()
Gets the value of n-- Returns:
- The value of n as integer
-
setN
void setN(int n)
Sets the value for n.- Parameters:
n- The required value for n
-
isCaseInsensitive
boolean isCaseInsensitive()
Gets boolean value, whether case is insensitive.- Returns:
- True, if case is insensitive
-
isCaseSensitive
boolean isCaseSensitive()
Gets boolean value, whether case is sensitive.- Returns:
- True, if case is sensitive
-
setCaseInsensitive
void setCaseInsensitive()
Sets case to insensitive.
-
setCaseSensitive
void setCaseSensitive()
Sets case to sensitive.
-
-