package fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.tees;

import fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.SectionModule;
import fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.SectionModule.SectionResolvedObjects;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.DefaultNames;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.NameType;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.creators.TupleCreator;
import fr.inra.maiage.bibliome.alvisnlp.core.module.lib.Param;
import fr.inra.maiage.bibliome.alvisnlp.core.module.types.MultiMapping;
import fr.inra.maiage.bibliome.util.files.ExecutableFile;
import fr.inra.maiage.bibliome.util.files.InputDirectory;

/**
 * 
 * @author mba
 *
 */

public abstract class TEESMapper extends SectionModule<SectionResolvedObjects> implements TupleCreator {
	protected static final String INTERNAL_ENCODING = "UTF-8";

	private String tokenLayerName = DefaultNames.getWordLayer();
	private String sentenceLayerName = DefaultNames.getSentenceLayer();
	private String posFeature = DefaultNames.getPosTagFeature();
	private String namedEntityTypeFeature = DefaultNames.getNamedEntityTypeFeature();
	private String namedEntityLayerName = null;
	
	private MultiMapping schema;
	
	private String omitSteps = "GENIA_SPLITTER,BANNER";
	private String steps ="LOAD,GENIA_SPLITTER,BANNER,BLLIP_BIO,STANFORD_CONVERT,SPLIT_NAMES,FIND_HEADS,SAVE";

	private ExecutableFile python2Executable;
	private InputDirectory teesHome;

	@Param(nameType = NameType.LAYER)
	public String getTokenLayerName() {
		return tokenLayerName;
	}
	
	public void setTokenLayerName(String tokenLayerName) {
		this.tokenLayerName = tokenLayerName;
	}

	@Param(nameType = NameType.LAYER)
	public String getSentenceLayerName() {
		return sentenceLayerName;
	}

	public void setSentenceLayerName(String sentenceLayerName) {
		this.sentenceLayerName = sentenceLayerName;
	}
	
	@Param(nameType = NameType.LAYER)
	public String getNamedEntityLayerName() {
		return namedEntityLayerName;
	}

	public void setNamedEntityLayerName(String namedEntityLayerName) {
		this.namedEntityLayerName = namedEntityLayerName;
	}
	
	@Param(nameType = NameType.FEATURE)
	public String getNamedEntityTypeFeature() {
		return namedEntityTypeFeature;
	}

	public void setNamedEntityTypeFeature(String namedEntityTypeFeature) {
		this.namedEntityTypeFeature = namedEntityTypeFeature;
	}
	
	@Param
	public MultiMapping getSchema() {
		return schema;
	}

	public void setSchema(MultiMapping schema) {
		this.schema = schema;
	}

	@Param
	public String getPosFeature() {
		return posFeature;
	}

	public void setPosFeature(String posFeature) {
		this.posFeature = posFeature;
	}
	
	@Param
	public String getOmitSteps() {
		return omitSteps;
	}

	public void setOmitSteps(String omitSteps) {
		this.omitSteps = omitSteps;
	}
	
	public String getSteps() {
		return steps;
	}

	public void setSteps(String steps) {
		this.steps = steps;
	}

	
	@Param
	public InputDirectory getTeesHome() {
		return teesHome;
	}

	public void setTeesHome(InputDirectory tEESHome) {
		teesHome = tEESHome;
	}

	@Param
	public ExecutableFile getPython2Executable() {
		return python2Executable;
	}

	public void setPython2Executable(ExecutableFile python2Executable) {
		this.python2Executable = python2Executable;
	}
}

@@ -1491,16 +1491,71 @@
 eesHome;
+%0A%09%0A%09private String detector = %22Detectors.EdgeDetector%22;
 %0A%0A%09@Para
@@ -3364,10 +3364,141 @@
 ble;%0A%09%7D%0A
+%09%0A%09public String getDetector() %7B%0A%09%09return detector;%0A%09%7D%0A%0A%09public void setDetector(String detector) %7B%0A%09%09this.detector = detector;%0A%09%7D%0A
 %7D%0A

update mapper