Package org.apache.ctakes.typesystem.type.textsem

Examples of org.apache.ctakes.typesystem.type.textsem.ContextAnnotation


        log.error("error negating annotation", iae);
      } catch (InvocationTargetException e) {
        log.error("error negating annotation", e);
      }
    }
    ContextAnnotation nec = new ContextAnnotation(aJCas);
    nec.setBegin(s.getBegin() + t.getStart() - 1);
    nec.setEnd(s.getBegin() + t.getEnd() - 1);
    nec.setScope(t.getTag());
    nec.setFocusText(anno.getCoveredText());
    nec.addToIndexes();
  }
View Full Code Here


public abstract class NamedEntityContextHitConsumer implements ContextHitConsumer {
  public abstract void consumeHit(JCas jcas, Annotation focusAnnot, int scope, ContextHit ctxHit)
      throws AnalysisEngineProcessException;

  protected ContextAnnotation createContextAnnot(JCas jcas, Annotation focusAnnot, int scope, ContextHit ctxHit) {
    ContextAnnotation ctxAnnot = new ContextAnnotation(jcas);
    ctxAnnot.setBegin(ctxHit.getStartOffset());
    ctxAnnot.setEnd(ctxHit.getEndOffset());
    if (scope == ContextAnnotator.LEFT_SCOPE) {
      ctxAnnot.setScope("LEFT");
    } else if (scope == ContextAnnotator.MIDDLE_SCOPE) {
      ctxAnnot.setScope("MIDDLE");
    } else if (scope == ContextAnnotator.RIGHT_SCOPE) {
      ctxAnnot.setScope("RIGHT");
    }
    ctxAnnot.setFocusText(focusAnnot.getCoveredText());
    return ctxAnnot;
  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.typesystem.type.textsem.ContextAnnotation

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.