public class NCDComparator extends ParameterLessComparisonBasedSkipExtendedComparator<String,String>
Modifier and Type | Class and Description |
---|---|
static class |
NCDComparator.CompressorType
This class contains all possible CompressorTypes for this NCD
implementation.
|
Constructor and Description |
---|
NCDComparator() |
Modifier and Type | Method and Description |
---|---|
double |
actualCompare(String a,
String b)
This has to return a distance between a and b with the following restrictions:
The return value has to lie between 0 and 1.
1 means maximum dissimilarity between a and b.
0 means maximum similarity between a and b (especially it should be true that a = b
implies a zero distance).
distance(a,b) should be equal or at least close to distance(b,a)
|
double |
calculateNCD(String x,
String y)
Returns the normalized compression distance between two input strings
according to the compressor currently set.
|
boolean |
equals(Object obj) |
int |
hashCode() |
computeComparisonGradient, getComparisonParameters, getNumberOfComparisonParameters, setComparisonParameters
compare, computeGradient
getNumberOfParameters, getParameters, hasCoherentReplacementCost, setParameters, supports
public double actualCompare(@NonNull String a, @NonNull String b)
SkipExtendedComparator
actualCompare
in class SkipExtendedComparator<String,String>
a
- the left input.b
- the right input.public int hashCode()
hashCode
in class ComparisonBasedSkipExtendedComparator<String,String>
public boolean equals(Object obj)
equals
in class ComparisonBasedSkipExtendedComparator<String,String>
public double calculateNCD(@NonNull String x, @NonNull String y)
x
- first input string.y
- second input string.Copyright (C) 2016 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/