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);
}
}
Aggregations