@Override public Sofa getSofa() { testLiveness(); return delegate.getSofa(); }
@Override @Deprecated public Sofa getSofa(SofaID sofaID) { testLiveness(); return delegate.getSofa(); }
/** * Write the sofa. * * @param generator the json generator * @param jCas the JCas * @throws IOException Signals that an I/O exception has occurred. */ private void writeSofa(JsonGenerator generator, JCas jCas) throws IOException { Sofa sofa = jCas.getSofa(); generator.writeFieldName("sofa"); writeFS(generator, sofa); }
Annotation copy = (Annotation) copier.copyFs(goldMention); Feature sofaFeature = copy.getType().getFeatureByBaseName("sofa"); copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
Annotation copy = (Annotation) copier.copyFs(goldMention); Feature sofaFeature = copy.getType().getFeatureByBaseName("sofa"); copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
for (IdentifiedAnnotation goldMention : goldMentions) { Annotation copy = (Annotation) copier.copyFs(goldMention); copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
for (IdentifiedAnnotation goldMention : goldMentions) { Annotation copy = (Annotation) copier.copyFs(goldMention); copy.setFeatureValue(sofaFeature, systemView.getSofa()); copy.addToIndexes();
forceSetFeatureValue(annotationCas.getSofa(), CAS.FEATURE_BASE_NAME_SOFASTRING, initialCas.getDocumentText()); FSUtil.setFeature(annotationCas.getDocumentAnnotationFs(), CAS.FEATURE_BASE_NAME_END,
forceSetFeatureValue(annotationCas.getSofa(), CAS.FEATURE_BASE_NAME_SOFASTRING, initialCas.getDocumentText()); FSUtil.setFeature(annotationCas.getDocumentAnnotationFs(), CAS.FEATURE_BASE_NAME_END,
copy.setFeatureValue( sofaFeature, systemView.getSofa() ); copy.addToIndexes( systemView ); existingSpans.add(key);
copy.setFeatureValue( sofaFeature, systemView.getSofa() ); copy.addToIndexes( systemView ); existingSpans.add(key);
@Override public void process(JCas jCas) throws AnalysisEngineProcessException { JCas sourceView; try { sourceView = jCas.getView(this.sourceViewName); } catch (CASException e) { throw new AnalysisEngineProcessException(e); } CasCopier copier = new CasCopier(sourceView.getCas(), jCas.getCas()); Feature sofaFeature = jCas.getTypeSystem().getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA); for (Event sourceEvent : JCasUtil.select(sourceView, Event.class)) { Event event = (Event) copier.copyFs(sourceEvent); event.setFeatureValue(sofaFeature, jCas.getSofa()); if (event.getEventInstanceID() == null) { event.setEventInstanceID(event.getId().replaceAll("^e", "ei")); } event.addToIndexes(); } for (Time sourceTime : JCasUtil.select(sourceView, Time.class)) { if (!(sourceTime instanceof DocumentCreationTime)) { Time time = (Time) copier.copyFs(sourceTime); time.setFeatureValue(sofaFeature, jCas.getSofa()); time.addToIndexes(); } } } }
@Override public void process(JCas jCas) throws AnalysisEngineProcessException { JCas sourceView; try { sourceView = jCas.getView(this.sourceViewName); } catch (CASException e) { throw new AnalysisEngineProcessException(e); } CasCopier copier = new CasCopier(sourceView.getCas(), jCas.getCas()); Feature sofaFeature = jCas.getTypeSystem().getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA); // copy document text jCas.setDocumentText(sourceView.getDocumentText()); // copy text annotation Text sourceText = JCasUtil.selectSingle(sourceView, Text.class); Text text = (Text) copier.copyFs(sourceText); text.setFeatureValue(sofaFeature, jCas.getSofa()); text.addToIndexes(); // copy document creation time DocumentCreationTime sourceTime = JCasUtil.selectSingle( sourceView, DocumentCreationTime.class); DocumentCreationTime time = (DocumentCreationTime) copier.copyFs(sourceTime); time.setFeatureValue(sofaFeature, jCas.getSofa()); time.addToIndexes(); } }
protected void afterProcess(JCas aInput, JCas aOutput) { // Copy the annotation types mentioned in PARAM_TYPES_TO_COPY // We have do do this in the afterProcess() phase, because otherwise the SofA in the // target CAS does not exist yet. CAS inputCas = aInput.getCas(); CasCopier copier = new CasCopier(inputCas, aOutput.getCas()); Feature mDestSofaFeature = aOutput.getTypeSystem() .getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA); for (String typeName : typesToCopy) { for (FeatureStructure fs : selectFS(inputCas, getType(inputCas, typeName))) { if (!copier.alreadyCopied(fs)) { FeatureStructure fsCopy = copier.copyFs(fs); // Make sure that the sofa annotation in the copy is set if (fs instanceof AnnotationBaseFS) { FeatureStructure sofa = fsCopy.getFeatureValue(mDestSofaFeature); if (sofa == null) { fsCopy.setFeatureValue(mDestSofaFeature, aOutput.getSofa()); } } aOutput.addFsToIndexes(fsCopy); } } } }
FeatureStructure sofa = fsCopy.getFeatureValue(mDestSofaFeature); if (sofa == null) { fsCopy.setFeatureValue(mDestSofaFeature, aOutput.getSofa());
.getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA), modview.getSofa()); final int mappedBegin = map[clone.getBegin()]; final int mappedEnd = map[clone.getEnd()];
.getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA), modview.getSofa()); final int mappedBegin = map[clone.getBegin()]; final int mappedEnd = map[clone.getEnd()];