in geoentitylinker-addon/src/main/java/opennlp/addons/geoentitylinker/scoring/PlacetypeScorer.java [46:59]
public void score(List<LinkedSpan<GazetteerEntry>> linkedSpans, String docText, Span[] sentenceSpans,
EntityLinkerProperties properties, AdminBoundaryContext additionalContext) {
for (LinkedSpan<GazetteerEntry> geospan : linkedSpans) {
ArrayList<GazetteerEntry> linkedEntries = geospan.getLinkedEntries();
for (GazetteerEntry gazetteerEntry : linkedEntries) {
String type = gazetteerEntry.getItemType().toLowerCase();
Double score = getScore(type);
if (score == null) {
score = 0d;
}
gazetteerEntry.getScoreMap().put("typescore", score);
}
}
}