// Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
// 
//     T entity1;
//     T entity2;
// 
//     String pattern;
//     String relation;
// 
//     public FoundFeature(T entity1, T entity2, String pattern) {
//         this.entity1 = entity1;
//         this.entity2 = entity2;
//         this.pattern = pattern;
//     }
// 
// 
//     public String getRelation() {
//         return relation;
//     }
// 
//     public void setRelation(String relation) {
//         this.relation = relation;
//     }
// 
//     public T getEntity1() {
//         return entity1;
//     }
// 
// 	public void setEntity1(T entity1) {
// 		this.entity1 = entity1;
// 	}
// 
// 	public T getEntity2() {
//         return entity2;
//     }
// 
// 	public void setEntity2(T entity2) {
// 		this.entity2 = entity2;
// 	}
// 
// 	public String getPattern() {
//         return pattern;
//     }
// 
// 	public void setPattern(String pattern) {
// 		this.pattern = pattern;
// 	}
// 
// 	@Override
//     public String toString() {
//         return "FoundFeature{" +
//                 "entity1=" + transformToString(entity1) +
//                 ", entity2=" + transformToString(entity2) +
//                 ", pattern='" + pattern + '\'' +
//                 ", relation='" + relation + '\'' +
//                 '}';
//     }
// 
//     private static <T> String transformToString(T input) {
//         if(input instanceof Annotation) {
//             return ((Annotation) input).getCoveredText();
//         } else {
//             return input.toString();
//         }
//     }
// }


import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.*;
import com.google.common.primitives.Ints;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChain;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceLink;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.CARD;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.O;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.PUNC;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import edu.tuberlin.dima.textmining.jedi.core.model.FoundFeature;
import org.apache.commons.lang.StringUtils;
import org.apache.uima.UIMAException;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.tcas.Annotation;
import org.jgrapht.DirectedGraph;
import org.jgrapht.GraphPath;
import org.jgrapht.Graphs;
import org.jgrapht.UndirectedGraph;
import org.jgrapht.alg.DijkstraShortestPath;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleDirectedGraph;
import javax.annotation.Nullable;
import java.util.*;
package edu.tuberlin.dima.textmining.jedi.core.features.detector;



/**
 */
public class AllPairsShortestPathFeatureExtractor extends AbstractShortestPathFeatureExtractor {

    public AllPairsShortestPathFeatureExtractor(String options) throws UIMAException {
        super(options);
    }

	public AllPairsShortestPathFeatureExtractor(String options, DetectorType detectorType) throws UIMAException {
		super(options);
		setName(detectorType.name());
	}


    @Override
// Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
// 
//     T entity1;
//     T entity2;
// 
//     String pattern;
//     String relation;
// 
//     public FoundFeature(T entity1, T entity2, String pattern) {
//         this.entity1 = entity1;
//         this.entity2 = entity2;
//         this.pattern = pattern;
//     }
// 
// 
//     public String getRelation() {
//         return relation;
//     }
// 
//     public void setRelation(String relation) {
//         this.relation = relation;
//     }
// 
//     public T getEntity1() {
//         return entity1;
//     }
// 
// 	public void setEntity1(T entity1) {
// 		this.entity1 = entity1;
// 	}
// 
// 	public T getEntity2() {
//         return entity2;
//     }
// 
// 	public void setEntity2(T entity2) {
// 		this.entity2 = entity2;
// 	}
// 
// 	public String getPattern() {
//         return pattern;
//     }
// 
// 	public void setPattern(String pattern) {
// 		this.pattern = pattern;
// 	}
// 
// 	@Override
//     public String toString() {
//         return "FoundFeature{" +
//                 "entity1=" + transformToString(entity1) +
//                 ", entity2=" + transformToString(entity2) +
//                 ", pattern='" + pattern + '\'' +
//                 ", relation='" + relation + '\'' +
//                 '}';
//     }
// 
//     private static <T> String transformToString(T input) {
//         if(input instanceof Annotation) {
//             return ((Annotation) input).getCoveredText();
//         } else {
//             return input.toString();
//         }
//     }
// }


// Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/AllPairsShortestPathFeatureExtractor.java
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.*;
import com.google.common.primitives.Ints;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChain;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceLink;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.CARD;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.O;
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.PUNC;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import edu.tuberlin.dima.textmining.jedi.core.model.FoundFeature;
import org.apache.commons.lang.StringUtils;
import org.apache.uima.UIMAException;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.tcas.Annotation;
import org.jgrapht.DirectedGraph;
import org.jgrapht.GraphPath;
import org.jgrapht.Graphs;
import org.jgrapht.UndirectedGraph;
import org.jgrapht.alg.DijkstraShortestPath;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleDirectedGraph;
import javax.annotation.Nullable;
import java.util.*;

package edu.tuberlin.dima.textmining.jedi.core.features.detector;



/**
 */
public class AllPairsShortestPathFeatureExtractor extends AbstractShortestPathFeatureExtractor {

    public AllPairsShortestPathFeatureExtractor(String options) throws UIMAException {
        super(options);
    }

	public AllPairsShortestPathFeatureExtractor(String options, DetectorType detectorType) throws UIMAException {
		super(options);
		setName(detectorType.name());
	}


    @Override
    public List<FoundFeature<Annotation>> getShortestPaths(UndirectedGraph<Token, DependencyEdge> graph) {