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

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

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

IdentifiedAnnotation.removeFromIndexes介绍

暂无

代码示例

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

private void removeExtraneousMentions(JCas jcas) {
    // TODO: how to remove if it is in a relation
    
    for (IdentifiedAnnotation mention : deletableMentions) {
      if (mention!=null) {
//                System.out.println("removing "+mention.toString());
        mention.removeFromIndexes();
      }
    }
  }

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

private void removeExtraneousMentions(JCas jcas) {
    // TODO: how to remove if it is in a relation
    
    for (IdentifiedAnnotation mention : deletableMentions) {
      if (mention!=null) {
//                System.out.println("removing "+mention.toString());
        mention.removeFromIndexes();
      }
    }
  }

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

/**
 * Remove duplicated NEs from Index (same type and offset)
 * @param jcas
 */
private void removeDuplicatedNEs(JCas jcas) {
  JFSIndexRepository indexes = jcas.getJFSIndexRepository();
  Iterator neItr= indexes.getAnnotationIndex(IdentifiedAnnotation.type).iterator();
  Set<String> spanSet = new HashSet<String>();
  List<IdentifiedAnnotation> duplicatedNE = new ArrayList<IdentifiedAnnotation>();
  
  while (neItr.hasNext()) {
    IdentifiedAnnotation nea = (IdentifiedAnnotation) neItr.next();            
    String span = Integer.toString(nea.getTypeID())+"|"+
      Integer.toString(nea.getBegin())+"|"+Integer.toString(nea.getEnd());
    if(spanSet.contains(span)) {
      duplicatedNE.add(nea);
    }
    spanSet.add(span);
  }
  
  for(IdentifiedAnnotation ne : duplicatedNE) {
    ne.removeFromIndexes();
  }
}

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

/**
 * Remove duplicated NEs from Index (same type and offset)
 * @param jcas
 */
private void removeDuplicatedNEs(JCas jcas) {
  JFSIndexRepository indexes = jcas.getJFSIndexRepository();
  Iterator neItr= indexes.getAnnotationIndex(IdentifiedAnnotation.type).iterator();
  Set<String> spanSet = new HashSet<String>();
  List<IdentifiedAnnotation> duplicatedNE = new ArrayList<IdentifiedAnnotation>();
  
  while (neItr.hasNext()) {
    IdentifiedAnnotation nea = (IdentifiedAnnotation) neItr.next();            
    String span = Integer.toString(nea.getTypeID())+"|"+
      Integer.toString(nea.getBegin())+"|"+Integer.toString(nea.getEnd());
    if(spanSet.contains(span)) {
      duplicatedNE.add(nea);
    }
    spanSet.add(span);
  }
  
  for(IdentifiedAnnotation ne : duplicatedNE) {
    ne.removeFromIndexes();
  }
}

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

cTakesMentions.addAll(JCasUtil.select(systemView, Modifier.class));
for (IdentifiedAnnotation cTakesMention : cTakesMentions) {
  cTakesMention.removeFromIndexes();

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

cTakesMentions.addAll(JCasUtil.select(systemView, Modifier.class));
for (IdentifiedAnnotation cTakesMention : cTakesMentions) {
  cTakesMention.removeFromIndexes();

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

for (IdentifiedAnnotation cTakesMention : cTakesMentions)
 cTakesMention.removeFromIndexes();

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

for (IdentifiedAnnotation cTakesMention : cTakesMentions)
 cTakesMention.removeFromIndexes();

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

cTakesMentions.addAll(JCasUtil.select(systemView, Modifier.class));
for (IdentifiedAnnotation cTakesMention : cTakesMentions) {
  cTakesMention.removeFromIndexes();

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

cTakesMentions.addAll(JCasUtil.select(systemView, Modifier.class));
for (IdentifiedAnnotation cTakesMention : cTakesMentions) {
  cTakesMention.removeFromIndexes();

相关文章

微信公众号

最新文章

更多