private AnnotationLayer createTokenLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); return tokenLayer; } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); } }
private AnnotationLayer createTokenLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); return tokenLayer; } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); // Since the user cannot turn off validation for the token layer if there is any kind of // problem with the validation functionality we are conservative here and disable validation // from the start. tokenLayer.setValidationMode(NEVER); annotationSchemaService.createLayer(tokenLayer); } }
private List<AnnotationLayer> layers() { AnnotationLayer layer1 = new AnnotationLayer("webanno.custom.Span", "Span", WebAnnoConst.SPAN_TYPE, project, false, AnchoringMode.SINGLE_TOKEN); layer1.setValidationMode(ValidationMode.ALWAYS); AnnotationLayer layer2 = new AnnotationLayer("webanno.custom.Span2", "Span2", WebAnnoConst.SPAN_TYPE, project, false, AnchoringMode.SENTENCES); layer2.setValidationMode(ValidationMode.NEVER); AnnotationLayer layer3 = new AnnotationLayer("webanno.custom.Relation", "Relation", WebAnnoConst.RELATION_TYPE, project, true, AnchoringMode.TOKENS); return asList(layer1, layer2, layer3); }
private void createNeLayer(Project aProject, TagSet aTagSet) throws IOException { AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", aTagSet)); }
private void createNeLayer(Project aProject, TagSet aTagSet) throws IOException { AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", aTagSet)); }
@Override public void configure(Project aProject) throws IOException { TagSet nerTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/de-ne-webanno.json").getInputStream(), annotationSchemaService); AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", nerTagSet)); } }
@Override public void configure(Project aProject) throws IOException { TagSet nerTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/de-ne-webanno.json").getInputStream(), annotationSchemaService); AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", nerTagSet)); } }
@Override public void onSubmit() { AnnotationLayer layer = new AnnotationLayer(); layer.setProject(ProjectLayersPanel.this.getModelObject()); layerDetailForm.setModelObject(layer); featureDetailForm.setModelObject(null); } });
@Override public void onSubmit() { AnnotationLayer layer = new AnnotationLayer(); layer.setProject(ProjectLayersPanel.this.getModelObject()); layerDetailForm.setModelObject(layer); featureDetailForm.setModelObject(null); } });
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, AnchoringMode.SINGLE_TOKEN); 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)); }
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, AnchoringMode.SINGLE_TOKEN); 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)); }
private void createChunkLayer(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(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); }
private void createChunkLayer(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(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); }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(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); } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(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); } }
@Override public void configure(Project aProject) throws IOException { // The surface form must be locked to tokens for CoNLL-U writer to work properly AnnotationLayer surfaceFormLayer = new AnnotationLayer(SurfaceForm.class.getName(), "Surface form", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); surfaceFormLayer.setAllowStacking(false); annotationSchemaService.createLayer(surfaceFormLayer); AnnotationFeature surfaceFormValueFeature = new AnnotationFeature(); surfaceFormValueFeature.setDescription("Original surface text"); surfaceFormValueFeature.setName("value"); surfaceFormValueFeature.setType(CAS.TYPE_NAME_STRING); surfaceFormValueFeature.setProject(aProject); surfaceFormValueFeature.setUiName("Form"); surfaceFormValueFeature.setLayer(surfaceFormLayer); annotationSchemaService.createFeature(surfaceFormValueFeature); } }
@Override public void onSubmit() { if (selectedProjectModel.getObject().getId() == 0) { error("Project not yet created. Please save project details first!"); } else { LayerSelectionForm.this.getModelObject().layerSelection = null; layerDetailForm.setModelObject(new AnnotationLayer()); layerDetailForm.setVisible(true); featureSelectionForm.setVisible(false); featureDetailForm.setVisible(false); } } });
@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); neLayer.setId(1l); featureSupportRegistry = new FeatureSupportRegistryImpl(asList()); }