// Path: graphene-core/src/main/java/org/lambda3/graphene/core/coreference/CoreferenceResolver.java
// public abstract class CoreferenceResolver {
// 	protected Config config;
// 
// 	public CoreferenceResolver(Config config) {
// 		this.config = config;
// 	}
// 
// 	public abstract CoreferenceContent doCoreferenceResolution(String text);
// }
// 
// Path: graphene-core/src/main/java/org/lambda3/graphene/core/coreference/model/CoreferenceContent.java
// public class CoreferenceContent extends Content {
// 
// 	private String originalText;
// 	private String substitutedText;
// 
// 	public CoreferenceContent() {
// 	}
// 
// 	public CoreferenceContent(String originalText, String substitutedText) {
// 		this.originalText = originalText;
// 		this.substitutedText = substitutedText;
// 	}
// 
// 	public String getOriginalText() {
// 		return originalText;
// 	}
// 
// 	public void setOriginalText(String originalText) {
// 		this.originalText = originalText;
// 	}
// 
// 	public String getSubstitutedText() {
// 		return substitutedText;
// 	}
// 
// 	public void setSubstitutedText(String substitutedText) {
// 		this.substitutedText = substitutedText;
// 	}
// 
// 	@Override
// 	public boolean equals(Object other) {
// 		if (other != null && other instanceof CoreferenceContent) {
// 			CoreferenceContent otherContent = (CoreferenceContent) other;
// 
// 			return new EqualsBuilder()
// 				.append(getOriginalText(), otherContent.getOriginalText())
// 				.append(getSubstitutedText(), otherContent.getSubstitutedText())
// 				.isEquals();
// 		}
// 		return false;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CoreferenceContent{" +
// 			"originalText='" + originalText + '\'' +
// 			", substitutedText='" + substitutedText + '\'' +
// 			'}';
// 	}
// }


import com.typesafe.config.Config;
import edu.stanford.nlp.coref.CorefCoreAnnotations;
import edu.stanford.nlp.coref.data.CorefChain;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;
import org.lambda3.graphene.core.coreference.CoreferenceResolver;
import org.lambda3.graphene.core.coreference.model.CoreferenceContent;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
			return words.stream()
				.filter(w -> w.keep)
				.map(w -> w.text)
				.collect(Collectors.joining(" "));
		}
	}

	private static final Properties PROPS = new Properties();
	static {
		PROPS.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,depparse,mention,parse,coref");
	}
	private static final StanfordCoreNLP PIPELINE = new StanfordCoreNLP(PROPS);



	public StanfordCoref(Config config) {
		super(config);
	}

	private static String getReplacement(String corefMention, String coreMention) {
		if (corefMention.trim().toLowerCase().matches("his|her")) {
			return coreMention + "'s";
		}
		if (corefMention.trim().toLowerCase().matches("their|our")) {
			return coreMention + "s'";
		}
		return coreMention;
	}

	@Override
// Path: graphene-core/src/main/java/org/lambda3/graphene/core/coreference/CoreferenceResolver.java
// public abstract class CoreferenceResolver {
// 	protected Config config;
// 
// 	public CoreferenceResolver(Config config) {
// 		this.config = config;
// 	}
// 
// 	public abstract CoreferenceContent doCoreferenceResolution(String text);
// }
// 
// Path: graphene-core/src/main/java/org/lambda3/graphene/core/coreference/model/CoreferenceContent.java
// public class CoreferenceContent extends Content {
// 
// 	private String originalText;
// 	private String substitutedText;
// 
// 	public CoreferenceContent() {
// 	}
// 
// 	public CoreferenceContent(String originalText, String substitutedText) {
// 		this.originalText = originalText;
// 		this.substitutedText = substitutedText;
// 	}
// 
// 	public String getOriginalText() {
// 		return originalText;
// 	}
// 
// 	public void setOriginalText(String originalText) {
// 		this.originalText = originalText;
// 	}
// 
// 	public String getSubstitutedText() {
// 		return substitutedText;
// 	}
// 
// 	public void setSubstitutedText(String substitutedText) {
// 		this.substitutedText = substitutedText;
// 	}
// 
// 	@Override
// 	public boolean equals(Object other) {
// 		if (other != null && other instanceof CoreferenceContent) {
// 			CoreferenceContent otherContent = (CoreferenceContent) other;
// 
// 			return new EqualsBuilder()
// 				.append(getOriginalText(), otherContent.getOriginalText())
// 				.append(getSubstitutedText(), otherContent.getSubstitutedText())
// 				.isEquals();
// 		}
// 		return false;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CoreferenceContent{" +
// 			"originalText='" + originalText + '\'' +
// 			", substitutedText='" + substitutedText + '\'' +
// 			'}';
// 	}
// }


// Path: graphene-core/src/main/java/org/lambda3/graphene/core/coreference/impl/stanford/StanfordCoref.java
import com.typesafe.config.Config;
import edu.stanford.nlp.coref.CorefCoreAnnotations;
import edu.stanford.nlp.coref.data.CorefChain;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;
import org.lambda3.graphene.core.coreference.CoreferenceResolver;
import org.lambda3.graphene.core.coreference.model.CoreferenceContent;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;

			return words.stream()
				.filter(w -> w.keep)
				.map(w -> w.text)
				.collect(Collectors.joining(" "));
		}
	}

	private static final Properties PROPS = new Properties();
	static {
		PROPS.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,depparse,mention,parse,coref");
	}
	private static final StanfordCoreNLP PIPELINE = new StanfordCoreNLP(PROPS);



	public StanfordCoref(Config config) {
		super(config);
	}

	private static String getReplacement(String corefMention, String coreMention) {
		if (corefMention.trim().toLowerCase().matches("his|her")) {
			return coreMention + "'s";
		}
		if (corefMention.trim().toLowerCase().matches("their|our")) {
			return coreMention + "s'";
		}
		return coreMention;
	}

	@Override
	public CoreferenceContent doCoreferenceResolution(String text) {