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 fix(Project aProject, Class<? extends TOP> aLayer, String aLayerType, AnnotationLayer aTokenLayer, String aFeature) { if (annotationSchemaService.existsLayer(aLayer.getName(), aLayerType, aProject)) { AnnotationLayer layer = annotationSchemaService.getLayer(aLayer.getName(), aProject); if (layer.getAttachFeature() == null) { layer.setAttachFeature(annotationSchemaService.getFeature(aFeature, aTokenLayer)); log.info("DATABASE UPGRADE PERFORMED: Fixed attach-feature of layer " + "[{}] ({}) in project [{}] ({})", layer.getUiName(), layer.getId(), aProject.getName(), aProject.getId()); } } } }
private void fix(Project aProject, Class<? extends TOP> aLayer, String aLayerType, AnnotationLayer aTokenLayer, String aFeature) { if (annotationSchemaService.existsLayer(aLayer.getName(), aLayerType, aProject)) { AnnotationLayer layer = annotationSchemaService.getLayer(aLayer.getName(), aProject); if (layer.getAttachFeature() == null) { layer.setAttachFeature(annotationSchemaService.getFeature(aFeature, aTokenLayer)); log.info("DATABASE UPGRADE PERFORMED: Fixed attach-feature of layer " + "[{}] ({}) in project [{}] ({})", layer.getUiName(), layer.getId(), aProject.getName(), aProject.getId()); } } } }
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)); }
@Override public void configure(Project aProject) throws IOException { TagSet posTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/mul-pos-ud.json").getInputStream(), annotationSchemaService); 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", posTagSet)); } }
@Override public void configure(Project aProject) throws IOException { TagSet posTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/mul-pos-ud.json").getInputStream(), annotationSchemaService); 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", posTagSet)); } }
AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
depLayer.setAttachFeature(tokenPosFeature);
depLayer.setAttachFeature(tokenPosFeature);
depLayer.setAttachFeature(tokenPosFeature);
depLayer.setAttachFeature(tokenPosFeature);
private void createLemmaLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenLemmaFeature = new AnnotationFeature(aProject, tokenLayer, "lemma", "lemma", Lemma.class.getName()); annotationSchemaService.createFeature(tokenLemmaFeature); AnnotationLayer lemmaLayer = new AnnotationLayer(Lemma.class.getName(), "Lemma", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); lemmaLayer.setAttachType(tokenLayer); lemmaLayer.setAttachFeature(tokenLemmaFeature); annotationSchemaService.createLayer(lemmaLayer); AnnotationFeature lemmaFeature = new AnnotationFeature(); lemmaFeature.setDescription("lemma Annotation"); lemmaFeature.setName("value"); lemmaFeature.setType(CAS.TYPE_NAME_STRING); lemmaFeature.setProject(aProject); lemmaFeature.setUiName("Lemma"); lemmaFeature.setLayer(lemmaLayer); annotationSchemaService.createFeature(lemmaFeature); }
private void createLemmaLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenLemmaFeature = new AnnotationFeature(aProject, tokenLayer, "lemma", "lemma", Lemma.class.getName()); annotationSchemaService.createFeature(tokenLemmaFeature); AnnotationLayer lemmaLayer = new AnnotationLayer(Lemma.class.getName(), "Lemma", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); lemmaLayer.setAttachType(tokenLayer); lemmaLayer.setAttachFeature(tokenLemmaFeature); annotationSchemaService.createLayer(lemmaLayer); AnnotationFeature lemmaFeature = new AnnotationFeature(); lemmaFeature.setDescription("lemma Annotation"); lemmaFeature.setName("value"); lemmaFeature.setType(CAS.TYPE_NAME_STRING); lemmaFeature.setProject(aProject); lemmaFeature.setUiName("Lemma"); lemmaFeature.setLayer(lemmaLayer); annotationSchemaService.createFeature(lemmaFeature); }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenLemmaFeature = new AnnotationFeature(aProject, tokenLayer, "lemma", "lemma", Lemma.class.getName()); annotationSchemaService.createFeature(tokenLemmaFeature); AnnotationLayer lemmaLayer = new AnnotationLayer(Lemma.class.getName(), "Lemma", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); lemmaLayer.setAttachType(tokenLayer); lemmaLayer.setAttachFeature(tokenLemmaFeature); annotationSchemaService.createLayer(lemmaLayer); AnnotationFeature lemmaFeature = new AnnotationFeature(); lemmaFeature.setDescription("lemma Annotation"); lemmaFeature.setName("value"); lemmaFeature.setType(CAS.TYPE_NAME_STRING); lemmaFeature.setProject(aProject); lemmaFeature.setUiName("Lemma"); lemmaFeature.setLayer(lemmaLayer); annotationSchemaService.createFeature(lemmaFeature); } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenLemmaFeature = new AnnotationFeature(aProject, tokenLayer, "lemma", "lemma", Lemma.class.getName()); annotationSchemaService.createFeature(tokenLemmaFeature); AnnotationLayer lemmaLayer = new AnnotationLayer(Lemma.class.getName(), "Lemma", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); lemmaLayer.setAttachType(tokenLayer); lemmaLayer.setAttachFeature(tokenLemmaFeature); annotationSchemaService.createLayer(lemmaLayer); AnnotationFeature lemmaFeature = new AnnotationFeature(); lemmaFeature.setDescription("lemma Annotation"); lemmaFeature.setName("value"); lemmaFeature.setType(CAS.TYPE_NAME_STRING); lemmaFeature.setProject(aProject); lemmaFeature.setUiName("Lemma"); lemmaFeature.setLayer(lemmaLayer); annotationSchemaService.createFeature(lemmaFeature); } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenMorphFeature = new AnnotationFeature(aProject, tokenLayer, "morph", "morph", Lemma.class.getName()); annotationSchemaService.createFeature(tokenMorphFeature); AnnotationLayer morphLayer = new AnnotationLayer(MorphologicalFeatures.class.getName(), "Morphological features", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); morphLayer.setAttachType(tokenLayer); morphLayer.setAttachFeature(tokenMorphFeature); annotationSchemaService.createLayer(morphLayer); AnnotationFeature valueFeature = new AnnotationFeature(); valueFeature.setDescription("Morphological features"); valueFeature.setName("value"); valueFeature.setType(CAS.TYPE_NAME_STRING); valueFeature.setProject(aProject); valueFeature.setUiName("Features"); valueFeature.setLayer(morphLayer); valueFeature.setIncludeInHover(true); valueFeature.setVisible(false); annotationSchemaService.createFeature(valueFeature); } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationFeature tokenMorphFeature = new AnnotationFeature(aProject, tokenLayer, "morph", "morph", Lemma.class.getName()); annotationSchemaService.createFeature(tokenMorphFeature); AnnotationLayer morphLayer = new AnnotationLayer(MorphologicalFeatures.class.getName(), "Morphological features", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); morphLayer.setAttachType(tokenLayer); morphLayer.setAttachFeature(tokenMorphFeature); annotationSchemaService.createLayer(morphLayer); AnnotationFeature valueFeature = new AnnotationFeature(); valueFeature.setDescription("Morphological features"); valueFeature.setName("value"); valueFeature.setType(CAS.TYPE_NAME_STRING); valueFeature.setProject(aProject); valueFeature.setUiName("Features"); valueFeature.setLayer(morphLayer); valueFeature.setIncludeInHover(true); valueFeature.setVisible(false); annotationSchemaService.createFeature(valueFeature); } }
depLayer.setId(3l); depLayer.setAttachType(tokenLayer); depLayer.setAttachFeature(tokenLayerPos); dependencyLayerGovernor = new AnnotationFeature(2l, depLayer, "Governor", Token.class.getName());
depLayer.setId(3l); depLayer.setAttachType(tokenLayer); depLayer.setAttachFeature(tokenLayerPos); dependencyLayerGovernor = new AnnotationFeature(2l, depLayer, "Governor", Token.class.getName());