Revision 53004
Added by Claudio Atzori over 5 years ago
modules/dnet-pace-core/trunk/src/main/java/eu/dnetlib/pace/condition/AbstractCondition.java | ||
---|---|---|
36 | 36 |
final Field va = a.values(fd.getName()); |
37 | 37 |
final Field vb = b.values(fd.getName()); |
38 | 38 |
|
39 |
//commented out shortcuts |
|
40 |
/* |
|
39 | 41 |
if ((va.isEmpty() || vb.isEmpty()) && fd.isIgnoreMissing()) { |
40 | 42 |
continue; |
41 | 43 |
} |
44 |
*/ |
|
42 | 45 |
res.put(fd.getName(), verify(fd, va, vb)); |
43 | 46 |
} |
44 | 47 |
return res; |
modules/dnet-pace-core/trunk/src/main/java/eu/dnetlib/pace/distance/eval/ScoreResult.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.pace.distance.eval; |
2 | 2 |
|
3 |
import com.google.gson.Gson; |
|
3 |
import com.google.gson.GsonBuilder;
|
|
4 | 4 |
|
5 | 5 |
/** |
6 | 6 |
* Created by claudio on 09/03/16. |
... | ... | |
49 | 49 |
|
50 | 50 |
@Override |
51 | 51 |
public String toString() { |
52 |
return new Gson().toJson(this); |
|
52 |
final GsonBuilder b = new GsonBuilder(); |
|
53 |
return b.setPrettyPrinting().create().toJson(this); |
|
53 | 54 |
} |
54 | 55 |
} |
modules/dnet-pace-core/trunk/src/main/java/eu/dnetlib/pace/distance/eval/ConditionEvalMap.java | ||
---|---|---|
17 | 17 |
} |
18 | 18 |
|
19 | 19 |
public boolean anyNegative() { |
20 |
return Iterables.all(values(), new Predicate<ConditionEval>() { |
|
21 |
@Override |
|
22 |
public boolean apply(final ConditionEval ec) { |
|
23 |
return ec.getResult() < 0; |
|
24 |
} |
|
25 |
}); |
|
20 |
return values().stream() |
|
21 |
.allMatch(ec -> ec.getResult() < 0); |
|
26 | 22 |
} |
27 | 23 |
|
28 | 24 |
public boolean isZero() { |
modules/dnet-pace-core/trunk/src/main/java/eu/dnetlib/pace/distance/DistanceScorer.java | ||
---|---|---|
46 | 46 |
for (final ConditionAlgo cd : conditions) { |
47 | 47 |
final ConditionEvalMap map = cd.verify(a, b); |
48 | 48 |
res.mergeFrom(map); |
49 |
|
|
50 |
// commented out shortcuts |
|
51 |
/* |
|
49 | 52 |
if (map.anyNegative()) { |
50 | 53 |
return res; |
51 | 54 |
} |
55 |
*/ |
|
52 | 56 |
|
53 | 57 |
//if (strict && (res < 0)) return -1; |
54 | 58 |
//cond += verify; |
Also available in: Unified diff
commented out shortcuts in score results evaluation