1
|
package eu.dnetlib.pace.distance;
|
2
|
|
3
|
import com.wcohen.ss.AbstractStringDistance;
|
4
|
|
5
|
public class MustBeDifferent extends SecondStringDistanceAlgo {
|
6
|
|
7
|
public MustBeDifferent(final double weight) {
|
8
|
super(weight, new com.wcohen.ss.JaroWinkler());
|
9
|
}
|
10
|
|
11
|
protected MustBeDifferent(final double weight, final AbstractStringDistance ssalgo) {
|
12
|
super(weight, ssalgo);
|
13
|
}
|
14
|
|
15
|
@Override
|
16
|
public double distance(final String a, final String b) {
|
17
|
return !a.equals(b) ? 1.0 : 0;
|
18
|
}
|
19
|
|
20
|
@Override
|
21
|
public double getWeight() {
|
22
|
return super.weight;
|
23
|
}
|
24
|
|
25
|
@Override
|
26
|
protected double normalize(final double d) {
|
27
|
return d;
|
28
|
}
|
29
|
|
30
|
}
|