Revision 43540
Added by Claudio Atzori over 7 years ago
PersonDistance.java | ||
---|---|---|
45 | 45 |
@Override |
46 | 46 |
public double distance(final Field a, final Field b) { |
47 | 47 |
|
48 |
final GTAuthor ga = Iterables.getLast(GTAuthor.fromOafJson(((FieldListImpl) a).stringList()));
|
|
49 |
final GTAuthor gb = Iterables.getLast(GTAuthor.fromOafJson(((FieldListImpl) b).stringList()));
|
|
48 |
final GTAuthor ga = Iterables.getLast(GTAuthor.fromDNGFJson(((FieldListImpl) a).stringList()));
|
|
49 |
final GTAuthor gb = Iterables.getLast(GTAuthor.fromDNGFJson(((FieldListImpl) b).stringList()));
|
|
50 | 50 |
|
51 | 51 |
if (commonAnchors != null && (anchorsInCommon(ga, gb).size() >= commonAnchors)) // log.info("matched coauthor intersection"); |
52 | 52 |
return 1.0; |
... | ... | |
54 | 54 |
if (commonSurnames != null && (surnamesInCommon(ga, gb).size() >= commonSurnames)) |
55 | 55 |
return 1.0; |
56 | 56 |
|
57 |
|
|
58 |
|
|
59 | 57 |
return 0; |
60 | 58 |
} |
61 | 59 |
|
Also available in: Unified diff
adapted to DNGF model