// Path: edits-core/src/main/java/org/edits/etaf/AnnotatedText.java
// @Data
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "AnnotatedText", propOrder = { "annotation" })
// public class AnnotatedText {
// 
// 	@XmlElement
// 	protected List<Annotation> annotation;
// 
// 	public AnnotatedText() {
// 		annotation = Lists.newArrayList();
// 	}
// }
// 
// Path: edits-core/src/main/java/org/edits/etaf/Annotation.java
// @Data
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "Annotation", propOrder = {})
// @XmlRootElement(name = "annotation")
// public class Annotation {
// 
// 	@XmlAttribute
// 	private String cpostag;
// 	@XmlAttribute
// 	private String deprel;
// 	@XmlAttribute
// 	private int end;
// 	@XmlAttribute
// 	private String feats;
// 	@XmlAttribute
// 	private String form;
// 	@XmlAttribute
// 	private String head;
// 	@XmlAttribute
// 	private String id;
// 	@XmlAttribute
// 	private String lemma;
// 	@XmlAttribute
// 	private String postag;
// 	@XmlAttribute
// 	private int start;
// 
// }


import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.log4j.Log4j;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.FSDirectory;
import org.edits.etaf.AnnotatedText;
import org.edits.etaf.Annotation;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
			Query q = new TermQuery(new Term(TERMDOC_FIELD, "true"));
			TopDocs td = searcher().search(q, 1);
			Document doc = searcher().doc(td.scoreDocs[0].doc);
			for (String d : doc.getValues(USES_FIELD))
				fields.add(d);
		} catch (Exception e) {
			log.debug(e);
			throw new RuntimeException("Could not load index from " + indexPath);
		}
	}

	@Override
	public RulesSource clone() {
		IndexRulesSource rs = new IndexRulesSource();
		rs.setFields(fields);
		rs.setIndexPath(indexPath);
		return rs;
	}

	@Override
	public void close() {
		try {
			searcher().getIndexReader().close();
		} catch (Exception e) {
			log.debug(e);
			throw new RuntimeException(e);
		}
	}

	@Override
// Path: edits-core/src/main/java/org/edits/etaf/AnnotatedText.java
// @Data
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "AnnotatedText", propOrder = { "annotation" })
// public class AnnotatedText {
// 
// 	@XmlElement
// 	protected List<Annotation> annotation;
// 
// 	public AnnotatedText() {
// 		annotation = Lists.newArrayList();
// 	}
// }
// 
// Path: edits-core/src/main/java/org/edits/etaf/Annotation.java
// @Data
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "Annotation", propOrder = {})
// @XmlRootElement(name = "annotation")
// public class Annotation {
// 
// 	@XmlAttribute
// 	private String cpostag;
// 	@XmlAttribute
// 	private String deprel;
// 	@XmlAttribute
// 	private int end;
// 	@XmlAttribute
// 	private String feats;
// 	@XmlAttribute
// 	private String form;
// 	@XmlAttribute
// 	private String head;
// 	@XmlAttribute
// 	private String id;
// 	@XmlAttribute
// 	private String lemma;
// 	@XmlAttribute
// 	private String postag;
// 	@XmlAttribute
// 	private int start;
// 
// }


// Path: edits-core/src/main/java/org/edits/rules/IndexRulesSource.java
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.log4j.Log4j;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.FSDirectory;
import org.edits.etaf.AnnotatedText;
import org.edits.etaf.Annotation;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

			Query q = new TermQuery(new Term(TERMDOC_FIELD, "true"));
			TopDocs td = searcher().search(q, 1);
			Document doc = searcher().doc(td.scoreDocs[0].doc);
			for (String d : doc.getValues(USES_FIELD))
				fields.add(d);
		} catch (Exception e) {
			log.debug(e);
			throw new RuntimeException("Could not load index from " + indexPath);
		}
	}

	@Override
	public RulesSource clone() {
		IndexRulesSource rs = new IndexRulesSource();
		rs.setFields(fields);
		rs.setIndexPath(indexPath);
		return rs;
	}

	@Override
	public void close() {
		try {
			searcher().getIndexReader().close();
		} catch (Exception e) {
			log.debug(e);
			throw new RuntimeException(e);
		}
	}

	@Override
	public List<Rule> extractRules(AnnotatedText t, AnnotatedText h) {