All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.datexis.encoder.EncoderAnnotator Maven / Gradle / Ivy

package de.datexis.encoder;

import com.google.common.collect.Lists;
import de.datexis.annotator.Annotator;
import de.datexis.tagger.EmptyTagger;
import org.nd4j.shade.jackson.annotation.JsonIgnore;

/**
 * A wrapper that holds a single encoder so it can be saved as an XML configuration.
 * @author Sebastian Arnold 
 */
public class EncoderAnnotator extends Annotator {
  
  public EncoderAnnotator() {}
  
  public EncoderAnnotator(Encoder encoder) {
    this.tagger = new EmptyTagger();
    this.tagger.setId("ENC");
    this.tagger.setEncoders(Lists.newArrayList(encoder));
    this.addComponent(encoder);
  }
  
  @JsonIgnore
  public Encoder getEncoder() {
    return tagger.getEncoders().get(0);
  }
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy