Package org.apache.stanbol.enhancer.engines.entitycomention.impl

Examples of org.apache.stanbol.enhancer.engines.entitycomention.impl.ContentItemMentionBuilder


        if(log.isDebugEnabled()){
            log.debug("compute co-mentions for ContentItem {} language {}  text={}",
                new Object []{ci.getUri().getUnicodeString(), language, StringUtils.abbreviate(at.getSpan(), 100)});
        }
        //create the in-memory database for the mentioned Entities
        ContentItemMentionBuilder entityMentionIndex = new ContentItemMentionBuilder(
            labelTokenizer, language, linkerConfig.getDefaultLanguage());
        MGraph metadata = ci.getMetadata();
        Set<UriRef> textAnnotations = new HashSet<UriRef>();
        ci.getLock().readLock().lock();
        try { //iterate over all TextAnnotations (mentions of Entities)
            for(Iterator<Triple> it = metadata.filter(null, RDF_TYPE, ENHANCER_TEXTANNOTATION); it.hasNext();){
                UriRef ta = (UriRef)it.next().getSubject();
                entityMentionIndex.registerTextAnnotation(ta, metadata);
                textAnnotations.add(ta); //store the registered text annotations
            }
        } finally {
            ci.getLock().readLock().unlock();
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.engines.entitycomention.impl.ContentItemMentionBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.