org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation.<init>()方法的一些代码示例,展示了IdentifiedAnnotation.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IdentifiedAnnotation.<init>()方法的具体详情如下:
包路径:org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation
类名称:IdentifiedAnnotation
方法名:<init>

IdentifiedAnnotation.<init>介绍

[英]Never called. Disable default constructor
[中]从未打过电话。禁用默认构造函数

代码示例

代码示例来源:origin: apache/ctakes

eMention = new EventMention(initView, first.start, last.end);
} else {
  eMention = new IdentifiedAnnotation(initView, first.start, last.end);

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

eMention = new EventMention(initView, first.start, last.end);
} else {
  eMention = new IdentifiedAnnotation(initView, first.start, last.end);

代码示例来源:origin: apache/ctakes

@Override
public void process(JCas jcas) throws AnalysisEngineProcessException {
  // Create a dummy IdentifiedAnnotation in the type system
  // If the BaseToken Part Of Speech is a Noun
  Collection<BaseToken> tokens = JCasUtil.select(jcas, BaseToken.class);
  for (BaseToken token : tokens) {
    if (saveAnnotation && token.getPartOfSpeech() != null
        && token.getPartOfSpeech().startsWith("N")) {
      IdentifiedAnnotation ann = new IdentifiedAnnotation(jcas);
      ann.setBegin(token.getBegin());
      ann.setEnd(token.getEnd());
      ann.addToIndexes();
      if (printAnnotation) {
        LOG.info("Token:" + token.getCoveredText() + " POS:"
            + token.getPartOfSpeech());
      }
    }
  }
}

代码示例来源:origin: org.apache.ctakes/ctakes-dictionary-lookup

IdentifiedAnnotation neAnnot = new IdentifiedAnnotation(jcas);
if ( typeId == CONST.NE_TYPE_ID_DRUG ) {
 neAnnot = new MedicationMention( jcas );

代码示例来源:origin: apache/ctakes

IdentifiedAnnotation neAnnot = new IdentifiedAnnotation(jcas);
if ( typeId == CONST.NE_TYPE_ID_DRUG ) {
 neAnnot = new MedicationMention( jcas );

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

/**
 * 
 * @param goldAnnotation
 * @param jcas
 */
private static void copyAnnotation(Annotation goldAnnotation, JCas jcas) {
  
  Annotation newAnno;
  if (goldAnnotation instanceof IdentifiedAnnotation) {
    IdentifiedAnnotation ia = new IdentifiedAnnotation(jcas);
    ia.setConditional(((IdentifiedAnnotation) goldAnnotation).getConditional());
    ia.setConfidence(((IdentifiedAnnotation) goldAnnotation).getConfidence());
    ia.setDiscoveryTechnique(((IdentifiedAnnotation)goldAnnotation).getDiscoveryTechnique());
    ia.setGeneric(((IdentifiedAnnotation) goldAnnotation).getGeneric());
    ia.setHistoryOf(((IdentifiedAnnotation) goldAnnotation).getHistoryOf());
    ia.setPolarity(((IdentifiedAnnotation) goldAnnotation).getPolarity());
    ia.setSegmentID(((IdentifiedAnnotation) goldAnnotation).getSegmentID());
    ia.setSentenceID(((IdentifiedAnnotation) goldAnnotation).getSentenceID());
    ia.setSubject(((IdentifiedAnnotation) goldAnnotation).getSubject());
    ia.setTypeID(((IdentifiedAnnotation) goldAnnotation).getTypeID());
    ia.setUncertainty(((IdentifiedAnnotation) goldAnnotation).getUncertainty());
    newAnno = ia;
  } else {
    throw new RuntimeException("Unexpected class of object " + goldAnnotation.getClass());
  }
  newAnno.setBegin(goldAnnotation.getBegin());
  newAnno.setEnd(goldAnnotation.getEnd());
  newAnno.addToIndexes();
  
}

代码示例来源:origin: apache/ctakes

/**
 * 
 * @param goldAnnotation
 * @param jcas
 */
private static void copyAnnotation(Annotation goldAnnotation, JCas jcas) {
  
  Annotation newAnno;
  if (goldAnnotation instanceof IdentifiedAnnotation) {
    IdentifiedAnnotation ia = new IdentifiedAnnotation(jcas);
    ia.setConditional(((IdentifiedAnnotation) goldAnnotation).getConditional());
    ia.setConfidence(((IdentifiedAnnotation) goldAnnotation).getConfidence());
    ia.setDiscoveryTechnique(((IdentifiedAnnotation)goldAnnotation).getDiscoveryTechnique());
    ia.setGeneric(((IdentifiedAnnotation) goldAnnotation).getGeneric());
    ia.setHistoryOf(((IdentifiedAnnotation) goldAnnotation).getHistoryOf());
    ia.setPolarity(((IdentifiedAnnotation) goldAnnotation).getPolarity());
    ia.setSegmentID(((IdentifiedAnnotation) goldAnnotation).getSegmentID());
    ia.setSentenceID(((IdentifiedAnnotation) goldAnnotation).getSentenceID());
    ia.setSubject(((IdentifiedAnnotation) goldAnnotation).getSubject());
    ia.setTypeID(((IdentifiedAnnotation) goldAnnotation).getTypeID());
    ia.setUncertainty(((IdentifiedAnnotation) goldAnnotation).getUncertainty());
    newAnno = ia;
  } else {
    throw new RuntimeException("Unexpected class of object " + goldAnnotation.getClass());
  }
  newAnno.setBegin(goldAnnotation.getBegin());
  newAnno.setEnd(goldAnnotation.getEnd());
  newAnno.addToIndexes();
  
}

相关文章

微信公众号

最新文章

更多