本文整理了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
暂无
代码示例来源: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();
内容来源于网络,如有侵权,请联系作者删除!