@Override @Transactional public TagSet createTagSet(String aDescription, String aTagSetName, String aLanguage, String[] aTags, String[] aTagDescription, Project aProject) throws IOException { TagSet tagSet = new TagSet(); tagSet.setDescription(aDescription); tagSet.setLanguage(aLanguage); tagSet.setName(aTagSetName); tagSet.setProject(aProject); createTagSet(tagSet); int i = 0; for (String tagName : aTags) { Tag tag = new Tag(); tag.setTagSet(tagSet); tag.setDescription(aTagDescription[i]); tag.setName(tagName); createTag(tag); i++; } return tagSet; }
@Override @Transactional public TagSet createTagSet(String aDescription, String aTagSetName, String aLanguage, String[] aTags, String[] aTagDescription, Project aProject) throws IOException { TagSet tagSet = new TagSet(); tagSet.setDescription(aDescription); tagSet.setLanguage(aLanguage); tagSet.setName(aTagSetName); tagSet.setProject(aProject); createTagSet(tagSet); int i = 0; for (String tagName : aTags) { Tag tag = new Tag(); tag.setTagSet(tagSet); tag.setDescription(aTagDescription[i]); tag.setName(tagName); createTag(tag); i++; } return tagSet; }
tag.setDescription(tabbedTagsetFromFile.get(key).replace( "\\n", "\n")); tag.setName(key);
tag.setDescription(tabbedTagsetFromFile.get(key).replace( "\\n", "\n")); tag.setName(key);
tag.setDescription(tabbedTagsetFromFile.get(key).replace( "\\n", "\n")); tag.setName(key);
@Deprecated public static void createTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject, User aUser, AnnotationSchemaService aAnnotationService) throws IOException { aTagSet.setCreateTag(aExTagSet.isCreateTag()); aTagSet.setDescription(aExTagSet.getDescription()); aTagSet.setLanguage(aExTagSet.getLanguage()); aTagSet.setName(aExTagSet.getName()); aTagSet.setProject(aProject); aAnnotationService.createTagSet(aTagSet); for (ExportedTag exTag : aExTagSet.getTags()) { // do not duplicate tag if (aAnnotationService.existsTag(exTag.getName(), aTagSet)) { continue; } Tag tag = new Tag(); tag.setDescription(exTag.getDescription()); tag.setTagSet(aTagSet); tag.setName(exTag.getName()); aAnnotationService.createTag(tag); } }
@Deprecated public static void createTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject, User aUser, AnnotationSchemaService aAnnotationService) throws IOException { aTagSet.setCreateTag(aExTagSet.isCreateTag()); aTagSet.setDescription(aExTagSet.getDescription()); aTagSet.setLanguage(aExTagSet.getLanguage()); aTagSet.setName(aExTagSet.getName()); aTagSet.setProject(aProject); aAnnotationService.createTagSet(aTagSet); for (ExportedTag exTag : aExTagSet.getTags()) { // do not duplicate tag if (aAnnotationService.existsTag(exTag.getName(), aTagSet)) { continue; } Tag tag = new Tag(); tag.setDescription(exTag.getDescription()); tag.setTagSet(aTagSet); tag.setName(exTag.getName()); aAnnotationService.createTag(tag); } }
tag.setDescription("noun"); tag.setName("NN"); tag.setTagSet(tagset);
private static TagSet replaceTagSet(Project project, ExportedTagSet importedTagSet, AnnotationSchemaService aAnnotationService) throws IOException { String importedTagSetName = importedTagSet.getName(); de.tudarmstadt.ukp.clarin.webanno.model.TagSet tagsetInUse = aAnnotationService .getTagSet(importedTagSetName, project); // Remove all tags associated with Tagset aAnnotationService.removeAllTags(tagsetInUse); // Copy and update TagSet Information from imported tagset tagsetInUse.setDescription(importedTagSet.getDescription()); tagsetInUse.setName(importedTagSetName); tagsetInUse.setLanguage(importedTagSet.getLanguage()); tagsetInUse.setProject(project); aAnnotationService.createTagSet(tagsetInUse); // Add all tags from imported tagset for (ExportedTag tag : importedTagSet.getTags()) { Tag newTag = new Tag(); newTag.setDescription(tag.getDescription()); newTag.setName(tag.getName()); newTag.setTagSet(tagsetInUse); aAnnotationService.createTag(newTag); } return tagsetInUse; }
private static TagSet replaceTagSet(Project project, ExportedTagSet importedTagSet, AnnotationSchemaService aAnnotationService) throws IOException { String importedTagSetName = importedTagSet.getName(); de.tudarmstadt.ukp.clarin.webanno.model.TagSet tagsetInUse = aAnnotationService .getTagSet(importedTagSetName, project); // Remove all tags associated with Tagset aAnnotationService.removeAllTags(tagsetInUse); // Copy and update TagSet Information from imported tagset tagsetInUse.setDescription(importedTagSet.getDescription()); tagsetInUse.setName(importedTagSetName); tagsetInUse.setLanguage(importedTagSet.getLanguage()); tagsetInUse.setProject(project); aAnnotationService.createTagSet(tagsetInUse); // Add all tags from imported tagset for (ExportedTag tag : importedTagSet.getTags()) { Tag newTag = new Tag(); newTag.setDescription(tag.getDescription()); newTag.setName(tag.getName()); newTag.setTagSet(tagsetInUse); aAnnotationService.createTag(newTag); } return tagsetInUse; }
public static void createTagSet(TagSet aTagSet, de.tudarmstadt.ukp.clarin.webanno.model.export.TagSet aExTagSet, Project aProject, User aUser, AnnotationService aAnnotationService) throws IOException { aTagSet.setCreateTag(aExTagSet.isCreateTag()); aTagSet.setDescription(aExTagSet.getDescription()); aTagSet.setLanguage(aExTagSet.getLanguage()); aTagSet.setName(aExTagSet.getName()); aTagSet.setProject(aProject); aAnnotationService.createTagSet(aTagSet, aUser); for (de.tudarmstadt.ukp.clarin.webanno.model.export.Tag exTag : aExTagSet.getTags()) { // du not duplicate tag if (aAnnotationService.existsTag(exTag.getName(), aTagSet)) { continue; } Tag tag = new Tag(); tag.setDescription(exTag.getDescription()); tag.setTagSet(aTagSet); tag.setName(exTag.getName()); aAnnotationService.createTag(tag, aUser); } }
private void importTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject) throws IOException { // aTagSet is a parameter because we want to use this also in the project settings // panel and have the ability there to merge imported tags into an existing tagset aTagSet.setCreateTag(aExTagSet.isCreateTag()); aTagSet.setDescription(aExTagSet.getDescription()); aTagSet.setLanguage(aExTagSet.getLanguage()); aTagSet.setName(aExTagSet.getName()); aTagSet.setProject(aProject); annotationService.createTagSet(aTagSet); for (ExportedTag exTag : aExTagSet.getTags()) { // do not duplicate tag if (annotationService.existsTag(exTag.getName(), aTagSet)) { continue; } Tag tag = new Tag(); tag.setDescription(exTag.getDescription()); tag.setTagSet(aTagSet); tag.setName(exTag.getName()); annotationService.createTag(tag); } } }
private void importTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject) throws IOException { // aTagSet is a parameter because we want to use this also in the project settings // panel and have the ability there to merge imported tags into an existing tagset aTagSet.setCreateTag(aExTagSet.isCreateTag()); aTagSet.setDescription(aExTagSet.getDescription()); aTagSet.setLanguage(aExTagSet.getLanguage()); aTagSet.setName(aExTagSet.getName()); aTagSet.setProject(aProject); annotationService.createTagSet(aTagSet); for (ExportedTag exTag : aExTagSet.getTags()) { // do not duplicate tag if (annotationService.existsTag(exTag.getName(), aTagSet)) { continue; } Tag tag = new Tag(); tag.setDescription(exTag.getDescription()); tag.setTagSet(aTagSet); tag.setName(exTag.getName()); annotationService.createTag(tag); } } }
private void createTagSet(Project project, User user, TagSet importedTagSet) throws IOException { if (annotationService.existsTagSet(importedTagSet.getName(), project)) { annotationService.removeTagSet(annotationService.getTagSet( importedTagSet.getName(), project)); } de.tudarmstadt.ukp.clarin.webanno.model.TagSet newTagSet = new de.tudarmstadt.ukp.clarin.webanno.model.TagSet(); newTagSet.setDescription(importedTagSet.getDescription()); newTagSet.setName(importedTagSet.getName()); newTagSet.setLanguage(importedTagSet.getLanguage()); newTagSet.setProject(project); annotationService.createTagSet(newTagSet, user); for (de.tudarmstadt.ukp.clarin.webanno.model.export.Tag tag : importedTagSet .getTags()) { Tag newTag = new Tag(); newTag.setDescription(tag.getDescription()); newTag.setName(tag.getName()); newTag.setTagSet(newTagSet); annotationService.createTag(newTag, user); } } });
public static TagSet createTagSet(Project project, ExportedTagSet importedTagSet, AnnotationSchemaService aAnnotationService) throws IOException { String importedTagSetName = importedTagSet.getName(); if (aAnnotationService.existsTagSet(importedTagSetName, project)) { // aAnnotationService.removeTagSet(aAnnotationService.getTagSet( // importedTagSet.getName(), project)); // Rename Imported TagSet instead of deleting the old one. importedTagSetName = copyTagSetName(aAnnotationService, importedTagSetName, project); } TagSet newTagSet = new TagSet(); newTagSet.setDescription(importedTagSet.getDescription()); newTagSet.setName(importedTagSetName); newTagSet.setLanguage(importedTagSet.getLanguage()); newTagSet.setProject(project); newTagSet.setCreateTag(importedTagSet.isCreateTag()); aAnnotationService.createTagSet(newTagSet); for (ExportedTag tag : importedTagSet.getTags()) { Tag newTag = new Tag(); newTag.setDescription(tag.getDescription()); newTag.setName(tag.getName()); newTag.setTagSet(newTagSet); aAnnotationService.createTag(newTag); } return newTagSet; }
public static TagSet createTagSet(Project project, ExportedTagSet importedTagSet, AnnotationSchemaService aAnnotationService) throws IOException { String importedTagSetName = importedTagSet.getName(); if (aAnnotationService.existsTagSet(importedTagSetName, project)) { // aAnnotationService.removeTagSet(aAnnotationService.getTagSet( // importedTagSet.getName(), project)); // Rename Imported TagSet instead of deleting the old one. importedTagSetName = copyTagSetName(aAnnotationService, importedTagSetName, project); } TagSet newTagSet = new TagSet(); newTagSet.setDescription(importedTagSet.getDescription()); newTagSet.setName(importedTagSetName); newTagSet.setLanguage(importedTagSet.getLanguage()); newTagSet.setProject(project); newTagSet.setCreateTag(importedTagSet.isCreateTag()); aAnnotationService.createTagSet(newTagSet); for (ExportedTag tag : importedTagSet.getTags()) { Tag newTag = new Tag(); newTag.setDescription(tag.getDescription()); newTag.setName(tag.getName()); newTag.setTagSet(newTagSet); aAnnotationService.createTag(newTag); } return newTagSet; }