private AnnotationFS createChainElementAnnotation(CreateSpanAnnotationRequest aRequest) { // Add the link annotation on the span AnnotationFS newLink = newLink(aRequest.getJcas(), aRequest.getBegin(), aRequest.getEnd()); // The added link is a new chain on its own - add the chain head FS newChain(aRequest.getJcas(), newLink); return newLink; }
public AnnotationFS handle(CreateSpanAnnotationRequest aRequest) throws AnnotationException { CreateSpanAnnotationRequest request = aRequest; for (SpanLayerBehavior behavior : behaviors) { request = behavior.onCreate(this, request); } return createChainElementAnnotation(request); }
public AnnotationFS addSpan(SourceDocument aDocument, String aUsername, JCas aJCas, int aBegin, int aEnd) throws AnnotationException { return handle(new CreateSpanAnnotationRequest(aDocument, aUsername, aJCas, aBegin, aEnd)); }
public AnnotationFS handle(CreateSpanAnnotationRequest aRequest) throws AnnotationException { CreateSpanAnnotationRequest request = aRequest; for (SpanLayerBehavior behavior : behaviors) { request = behavior.onCreate(this, request); } AnnotationFS newAnnotation = createSpanAnnotation(request.getJcas().getCas(), request.getBegin(), request.getEnd()); publishEvent(new SpanCreatedEvent(this, request.getDocument(), request.getUsername(), newAnnotation)); return newAnnotation; }
public AnnotationFS handle(CreateRelationAnnotationRequest aRequest) throws AnnotationException { CreateRelationAnnotationRequest request = aRequest; for (RelationLayerBehavior behavior : behaviors) { request = behavior.onCreate(this, request); } return createRelationAnnotation(request.getJcas().getCas(), request.getOriginFs(), request.getTargetFs()); }
public static String getUiTypeName(TypeAdapter aAdapter) { return aAdapter.getTypeId() + "_" + aAdapter.getAnnotationTypeName(); }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }
public CreateSpanAnnotationRequest changeSpan(int aBegin, int aEnd) { return new CreateSpanAnnotationRequest(this, document, username, jcas, aBegin, aEnd); } }
public CreateRelationAnnotationRequest changeRelation(AnnotationFS aOrigin, AnnotationFS aTarget) { return new CreateRelationAnnotationRequest(this, document, username, jcas, aOrigin, aTarget, windowBegin, windowEnd); } }
private AnnotationFS createChainElementAnnotation(CreateSpanAnnotationRequest aRequest) { // Add the link annotation on the span AnnotationFS newLink = newLink(aRequest.getJcas(), aRequest.getBegin(), aRequest.getEnd()); // The added link is a new chain on its own - add the chain head FS newChain(aRequest.getJcas(), newLink); return newLink; }
public AnnotationFS handle(CreateRelationAnnotationRequest aRequest) throws AnnotationException { CreateRelationAnnotationRequest request = aRequest; for (RelationLayerBehavior behavior : behaviors) { request = behavior.onCreate(this, request); } return createRelationAnnotation(request.getJcas().getCas(), request.getOriginFs(), request.getTargetFs()); }
public AnnotationFS handle(CreateSpanAnnotationRequest aRequest) throws AnnotationException { CreateSpanAnnotationRequest request = aRequest; for (SpanLayerBehavior behavior : behaviors) { request = behavior.onCreate(this, request); } return createChainElementAnnotation(request); }
public AnnotationFS addSpan(SourceDocument aDocument, String aUsername, JCas aJCas, int aBegin, int aEnd) throws AnnotationException { return handle(new CreateSpanAnnotationRequest(aDocument, aUsername, aJCas, aBegin, aEnd)); }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }
public CreateSpanAnnotationRequest changeSpan(int aBegin, int aEnd) { return new CreateSpanAnnotationRequest(this, document, username, jcas, aBegin, aEnd); } }
public CreateRelationAnnotationRequest changeRelation(AnnotationFS aOrigin, AnnotationFS aTarget) { return new CreateRelationAnnotationRequest(this, document, username, jcas, aOrigin, aTarget, windowBegin, windowEnd); } }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }
@Override public boolean accepts(LayerSupport<?> aLayerType) { return super.accepts(aLayerType) || aLayerType instanceof ChainLayerSupport; }