public class CharStatComparator extends ParameterLessComparisonBasedSkipExtendedComparator<String,String>
Constructor and Description |
---|
CharStatComparator() |
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)
|
static double |
distance(String a,
String b)
This calculates the distance between the two strings a and b calculating for each
alphanumeric character (a-z, 0-9) the number of times it occured in both strings at taking
the difference of both.
|
computeComparisonGradient, getComparisonParameters, getNumberOfComparisonParameters, setComparisonParameters
compare, computeGradient, equals, hashCode
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 static double distance(@NonNull String a, @NonNull String b)
a
- the first input string.b
- the second input string.Copyright (C) 2016-2018 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/