use of de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature in project webanno by webanno.
the class LegacyProjectInitializer method createPOSLayer.
private void createPOSLayer(Project aProject, TagSet aPosTagset) throws IOException {
AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject);
AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, aProject, true);
AnnotationFeature tokenPosFeature = new AnnotationFeature(aProject, tokenLayer, "pos", "pos", POS.class.getName());
annotationSchemaService.createFeature(tokenPosFeature);
posLayer.setAttachType(tokenLayer);
posLayer.setAttachFeature(tokenPosFeature);
annotationSchemaService.createLayer(posLayer);
annotationSchemaService.createFeature(new AnnotationFeature(aProject, posLayer, "PosValue", "PosValue", CAS.TYPE_NAME_STRING, "Part-of-speech tag", aPosTagset));
}
use of de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature in project webanno by webanno.
the class LegacyProjectInitializer method createChunkLayer.
private void createChunkLayer(Project aProject) throws IOException {
AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true);
chunkLayer.setAllowStacking(false);
chunkLayer.setMultipleTokens(true);
chunkLayer.setLockToTokenOffset(false);
annotationSchemaService.createLayer(chunkLayer);
AnnotationFeature chunkValueFeature = new AnnotationFeature();
chunkValueFeature.setDescription("Chunk tag");
chunkValueFeature.setName("chunkValue");
chunkValueFeature.setType(CAS.TYPE_NAME_STRING);
chunkValueFeature.setProject(aProject);
chunkValueFeature.setUiName("Tag");
chunkValueFeature.setLayer(chunkLayer);
annotationSchemaService.createFeature(chunkValueFeature);
}
use of de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature in project webanno by webanno.
the class LegacyProjectInitializer method createCorefLayer.
private AnnotationLayer createCorefLayer(Project aProject, TagSet aCorefTypeTags, TagSet aCorefRelTags) throws IOException {
AnnotationLayer base = new AnnotationLayer("de.tudarmstadt.ukp.dkpro.core.api.coref.type.Coreference", "Coreference", CHAIN_TYPE, aProject, true);
base.setCrossSentence(true);
base.setAllowStacking(true);
base.setMultipleTokens(true);
base.setLockToTokenOffset(false);
annotationSchemaService.createLayer(base);
annotationSchemaService.createFeature(new AnnotationFeature(aProject, base, "referenceType", "referenceType", CAS.TYPE_NAME_STRING, "Coreference type", aCorefTypeTags));
annotationSchemaService.createFeature(new AnnotationFeature(aProject, base, "referenceRelation", "referenceRelation", CAS.TYPE_NAME_STRING, "Coreference relation", aCorefRelTags));
return base;
}
Aggregations