this.mixture = mixture;
}
@Override
public DBpediaResourceOccurrence disambiguate(SurfaceFormOccurrence sfOcc) throws SearchException, ItemNotFoundException, InputException {
DBpediaResourceOccurrence resultOcc = null;
List<DBpediaResourceOccurrence> bestKsuper = super.bestK(sfOcc, Integer.MAX_VALUE);
double best = -Double.MAX_VALUE;
double second;
for(DBpediaResourceOccurrence occ : bestKsuper) {
double mixedScore = mixture.getScore(occ);
if(mixedScore > best) {
second = best;
best = mixedScore;
resultOcc = occ;
resultOcc.setSimilarityScore(mixedScore);
if(second > -Double.MAX_VALUE) {
resultOcc.setPercentageOfSecondRank(second/best);
}
}
}
if(resultOcc == null) {