@Override public void delete(JCas aJCas, int aAddress) { FeatureStructure fs = BratAjaxCasUtil.selectByAddr(aJCas, FeatureStructure.class, aAddress); aJCas.removeFsFromIndexes(fs); }
@Override public void removeFsFromIndexes(FeatureStructure fs) { testLiveness(); delegate.removeFsFromIndexes(fs); }
public static void clearJcas(JCas aJCas, SourceDocument aSourceDocument, User aUser, RepositoryService repository) throws IOException { List<Annotation> annotationsToRemove = new ArrayList<Annotation>(); for (Annotation a : select(aJCas, Annotation.class)) { if (!(a instanceof Token || a instanceof Sentence || a instanceof DocumentMetaData)) { annotationsToRemove.add(a); } } for (Annotation annotation : annotationsToRemove) { aJCas.removeFsFromIndexes(annotation); } repository.createAnnotationDocumentContent(aJCas, aSourceDocument, aUser); }
public static void clearAnnotations(JCas aJCas, Type aType) throws IOException { List<AnnotationFS> annotationsToRemove = new ArrayList<>(); annotationsToRemove.addAll(select(aJCas.getCas(), aType)); for (AnnotationFS annotation : annotationsToRemove) { aJCas.removeFsFromIndexes(annotation); } }
public static void clearAnnotations(JCas aJCas, Type aType) throws IOException { List<AnnotationFS> annotationsToRemove = new ArrayList<AnnotationFS>(); for (AnnotationFS a : select(aJCas.getCas(), aType)) { annotationsToRemove.add(a); } for (AnnotationFS annotation : annotationsToRemove) { aJCas.removeFsFromIndexes(annotation); } } }
public static void clearAnnotations(JCas aJCas, Type aType) throws IOException { List<AnnotationFS> annotationsToRemove = new ArrayList<>(); annotationsToRemove.addAll(select(aJCas.getCas(), aType)); for (AnnotationFS annotation : annotationsToRemove) { aJCas.removeFsFromIndexes(annotation); } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { Set<AnnotationFS> toRemove = new HashSet<>(); try { for (Entry<AnnotationFS, String> entry : FeaturePathFactory.select(aJCas.getCas(), typeName)) { String text = ignoreCase ? entry.getValue().toLowerCase() : entry.getValue(); if (!words.contains(text)) { toRemove.add(entry.getKey()); } } } catch (FeaturePathException e) { throw new AnalysisEngineProcessException(e); } for (AnnotationFS annotation : toRemove) { aJCas.removeFsFromIndexes(annotation); } }
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { FeatureStructure fs = selectByAddr(aJCas, FeatureStructure.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); }
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { FeatureStructure fs = selectByAddr(aJCas, FeatureStructure.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); }
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { AnnotationBase fs = selectByAddr(aJCas, AnnotationBase.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); publishEvent(new DocumentMetadataDeletedEvent(this, aDocument, aUsername, fs)); }
jCas.removeFsFromIndexes( crossBounds.getKey() );
mergedTokenStrings.add(entry.getKey().getCoveredText()); for (AnnotationFS anno : entry.getValue()) { jCas.removeFsFromIndexes(anno);
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { AnnotationBase fs = selectByAddr(aJCas, AnnotationBase.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); publishEvent(new DocumentMetadataDeletedEvent(this, aDocument, aUsername, fs)); }
jCas.removeFsFromIndexes( crossBounds.getKey() );
jCas.removeFsFromIndexes(idFs);
@Override public void delete(JCas aJCas, int aAddress) { FeatureStructure fs = BratAjaxCasUtil.selectByAddr(aJCas, FeatureStructure.class, aAddress); aJCas.removeFsFromIndexes(fs); // delete associated attachFeature if (getAttachTypeName() == null) { return; } Type theType = CasUtil.getType(aJCas.getCas(), getAttachTypeName()); Feature attachFeature = theType.getFeatureByBaseName(getAttachFeatureName()); if (attachFeature == null) { return; } CasUtil.selectCovered(aJCas.getCas(), theType, ((AnnotationFS) fs).getBegin(), ((AnnotationFS) fs).getEnd()).get(0).setFeatureValue(attachFeature, null); }
aJCas.removeFsFromIndexes(fs);
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { AnnotationFS fs = selectByAddr(aJCas, AnnotationFS.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); // delete associated attachFeature if (getAttachTypeName() != null) { Type theType = CasUtil.getType(aJCas.getCas(), getAttachTypeName()); Feature attachFeature = theType.getFeatureByBaseName(getAttachFeatureName()); if (attachFeature != null) { CasUtil.selectCovered(aJCas.getCas(), theType, fs.getBegin(), fs.getEnd()).get(0) .setFeatureValue(attachFeature, null); } } publishEvent(new SpanDeletedEvent(this, aDocument, aUsername, getLayer(), fs)); }
@Override public void delete(SourceDocument aDocument, String aUsername, JCas aJCas, VID aVid) { AnnotationFS fs = selectByAddr(aJCas, AnnotationFS.class, aVid.getId()); aJCas.removeFsFromIndexes(fs); // delete associated attachFeature if (getAttachTypeName() != null) { Type theType = CasUtil.getType(aJCas.getCas(), getAttachTypeName()); Feature attachFeature = theType.getFeatureByBaseName(getAttachFeatureName()); if (attachFeature != null) { CasUtil.selectCovered(aJCas.getCas(), theType, fs.getBegin(), fs.getEnd()).get(0) .setFeatureValue(attachFeature, null); } } publishEvent(new SpanDeletedEvent(this, aDocument, aUsername, getLayer(), fs)); }
jCas.removeFsFromIndexes(idFs);