Search in sources :

Example 6 with LayerSupportRegistryImpl

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl in project webanno by webanno.

the class RelationRendererTest method setup.

@Before
public void setup() throws Exception {
    if (jcas == null) {
        jcas = JCasFactory.createJCas();
    } else {
        jcas.reset();
    }
    username = "user";
    project = new Project();
    project.setId(1l);
    project.setMode(PROJECT_TYPE_ANNOTATION);
    document = new SourceDocument();
    document.setId(1l);
    document.setProject(project);
    // Set up annotation schema with POS and Dependency
    AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, project, true, SINGLE_TOKEN, NO_OVERLAP);
    tokenLayer.setId(1l);
    AnnotationFeature tokenLayerPos = new AnnotationFeature(1l, tokenLayer, "pos", POS.class.getName());
    AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, project, true, SINGLE_TOKEN, NO_OVERLAP);
    posLayer.setId(2l);
    depLayer = new AnnotationLayer(Dependency.class.getName(), "Dependency", RELATION_TYPE, project, true, SINGLE_TOKEN, OVERLAP_ONLY);
    depLayer.setId(3l);
    depLayer.setAttachType(tokenLayer);
    depLayer.setAttachFeature(tokenLayerPos);
    dependencyLayerGovernor = new AnnotationFeature(2l, depLayer, "Governor", Token.class.getName());
    dependencyLayerDependent = new AnnotationFeature(3l, depLayer, "Dependent", Token.class.getName());
    featureSupportRegistry = new FeatureSupportRegistryImpl(asList());
    layerSupportRegistry = new LayerSupportRegistryImpl(asList());
    behaviors = asList(new RelationAttachmentBehavior(), new RelationOverlapBehavior(), new RelationCrossSentenceBehavior());
}
Also used : Project(de.tudarmstadt.ukp.clarin.webanno.model.Project) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) RelationCrossSentenceBehavior(de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationCrossSentenceBehavior) FeatureSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistryImpl) SourceDocument(de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument) RelationOverlapBehavior(de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationOverlapBehavior) Token(de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token) LayerSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl) RelationAttachmentBehavior(de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationAttachmentBehavior) AnnotationLayer(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature) Before(org.junit.Before)

Example 7 with LayerSupportRegistryImpl

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl in project webanno by webanno.

the class SpanRendererTest method setup.

@Before
public void setup() throws Exception {
    if (jcas == null) {
        jcas = JCasFactory.createJCas();
    } else {
        jcas.reset();
    }
    project = new Project();
    project.setId(1l);
    project.setMode(PROJECT_TYPE_ANNOTATION);
    neLayer = new AnnotationLayer(NamedEntity.class.getName(), "NE", SPAN_TYPE, project, true, TOKENS, ANY_OVERLAP);
    neLayer.setId(1l);
    featureSupportRegistry = new FeatureSupportRegistryImpl(asList());
    layerSupportRegistry = new LayerSupportRegistryImpl(asList());
}
Also used : Project(de.tudarmstadt.ukp.clarin.webanno.model.Project) FeatureSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistryImpl) LayerSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl) AnnotationLayer(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer) Before(org.junit.Before)

Example 8 with LayerSupportRegistryImpl

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl in project webanno by webanno.

the class RelationAdapterTest method setup.

@Before
public void setup() throws Exception {
    if (jcas == null) {
        jcas = JCasFactory.createJCas();
    } else {
        jcas.reset();
    }
    username = "user";
    project = new Project();
    project.setId(1l);
    project.setMode(PROJECT_TYPE_ANNOTATION);
    document = new SourceDocument();
    document.setId(1l);
    document.setProject(project);
    // Set up annotation schema with POS and Dependency
    AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, project, true, SINGLE_TOKEN, NO_OVERLAP);
    tokenLayer.setId(1l);
    AnnotationFeature tokenLayerPos = new AnnotationFeature(1l, tokenLayer, "pos", POS.class.getName());
    AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, project, true, SINGLE_TOKEN, NO_OVERLAP);
    posLayer.setId(2l);
    depLayer = new AnnotationLayer(Dependency.class.getName(), "Dependency", RELATION_TYPE, project, true, SINGLE_TOKEN, OVERLAP_ONLY);
    depLayer.setId(3l);
    depLayer.setAttachType(tokenLayer);
    depLayer.setAttachFeature(tokenLayerPos);
    dependencyLayerGovernor = new AnnotationFeature(2l, depLayer, "Governor", Token.class.getName());
    dependencyLayerDependent = new AnnotationFeature(3l, depLayer, "Dependent", Token.class.getName());
    layerSupportRegistry = new LayerSupportRegistryImpl(asList());
    featureSupportRegistry = new FeatureSupportRegistryImpl(asList());
    behaviors = asList(new RelationAttachmentBehavior(), new RelationOverlapBehavior(), new RelationCrossSentenceBehavior());
}
Also used : Project(de.tudarmstadt.ukp.clarin.webanno.model.Project) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) FeatureSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistryImpl) SourceDocument(de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument) Token(de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token) LayerSupportRegistryImpl(de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl) AnnotationLayer(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature) Before(org.junit.Before)

Aggregations

FeatureSupportRegistryImpl (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistryImpl)8 LayerSupportRegistryImpl (de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistryImpl)8 AnnotationLayer (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer)8 Project (de.tudarmstadt.ukp.clarin.webanno.model.Project)8 Before (org.junit.Before)8 SourceDocument (de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument)5 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)4 POS (de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS)4 BooleanFeatureSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.BooleanFeatureSupport)3 NumberFeatureSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.NumberFeatureSupport)3 SlotFeatureSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.SlotFeatureSupport)3 StringFeatureSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.StringFeatureSupport)3 ChainLayerSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.ChainLayerSupport)3 LayerBehaviorRegistryImpl (de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerBehaviorRegistryImpl)3 RelationLayerSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.RelationLayerSupport)3 SpanLayerSupport (de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.SpanLayerSupport)3 Token (de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token)3 RelationAttachmentBehavior (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationAttachmentBehavior)1 RelationCrossSentenceBehavior (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationCrossSentenceBehavior)1 RelationOverlapBehavior (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.RelationOverlapBehavior)1