Search in sources :

Example 1 with MiraTemplate

use of de.tudarmstadt.ukp.clarin.webanno.export.model.MiraTemplate in project webanno by webanno.

the class ImportUtil method createMiraTemplate.

public static void createMiraTemplate(de.tudarmstadt.ukp.clarin.webanno.export.model.Project aImportedProjectSetting, AutomationService aRepository, Map<String, AnnotationFeature> aFeatureMaps) {
    for (MiraTemplate exTemplate : aImportedProjectSetting.getMiraTemplates()) {
        de.tudarmstadt.ukp.clarin.webanno.automation.model.MiraTemplate template = new de.tudarmstadt.ukp.clarin.webanno.automation.model.MiraTemplate();
        template.setAnnotateAndRepeat(exTemplate.isAnnotateAndPredict());
        template.setAutomationStarted(false);
        template.setCurrentLayer(exTemplate.isCurrentLayer());
        template.setResult("---");
        template.setTrainFeature(aFeatureMaps.get(exTemplate.getTrainFeature().getName()));
        Set<AnnotationFeature> otherFeatures = new HashSet<>();
        if (exTemplate.getOtherFeatures() != null) {
            for (de.tudarmstadt.ukp.clarin.webanno.export.model.AnnotationFeature other : exTemplate.getOtherFeatures()) {
                otherFeatures.add(aFeatureMaps.get(other.getName()));
            }
            template.setOtherFeatures(otherFeatures);
        }
        aRepository.createTemplate(template);
    }
}
Also used : MiraTemplate(de.tudarmstadt.ukp.clarin.webanno.export.model.MiraTemplate) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature) HashSet(java.util.HashSet)

Aggregations

MiraTemplate (de.tudarmstadt.ukp.clarin.webanno.export.model.MiraTemplate)1 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)1 HashSet (java.util.HashSet)1