} catch (ParseException e) {
throw new IllegalStateException("Unable to parse the ld-path selector '" +
path + "'used to select the confidence of suggestions!", e);
}
//The resultSelector is NULL because this directly returns the EntityAnnotations
addFunction(CONFIG,new SuggestionFunction("suggestion",linkedEntityAnnotations,confidenceSelector,null));
//Suggested Entities for Text/TopicAnnotations
//The suggestion and confidence selectors can be the same as above,
//but we need an additional result selector
NodeSelector<Resource> entityReferenceSelector;
path = ENHANCER_ENTITY_REFERENCE.toString();
try {
entityReferenceSelector = Utils.parseSelector(path);
} catch (ParseException e) {
throw new IllegalStateException("Unable to parse the ld-path selector '" +
path + "'used to select the entity referenced by a EntityAnnotation!", e);
}
addFunction(CONFIG, new SuggestionFunction("suggestedEntity",
linkedEntityAnnotations,confidenceSelector,entityReferenceSelector));
}
return CONFIG;
}