throw new IllegalStateException("The language '"+language+"' is not configured "
+ "to be processed by this Engine. As this is already checked within the "
+ "canEnhance(..) method this may indicate an bug in the used "
+ "EnhanceemntJobManager implementation!");
}
EntityLinker entityLinker = new EntityLinker(at,language,
languageConfig, entitySearcher, linkerConfig, labelTokenizer);
//process
try {
entityLinker.process();
} catch (EntitySearcherException e) {
log.error("Unable to link Entities with "+entityLinker,e);
throw new EngineException(this, ci, "Unable to link Entities with "+entityLinker, e);
}
if(log.isInfoEnabled()){
entityLinker.logStatistics(log);
}
//write results (requires a write lock)
ci.getLock().writeLock().lock();
try {
writeEnhancements(ci, entityLinker.getLinkedEntities().values(), language);
} finally {
ci.getLock().writeLock().unlock();
}
}