// Path: src/io/Sentence.java
// public class Sentence {
// 	public ArrayList<String> words;
// 	public ArrayList<String> postags;
// 	public ArrayList<ArrayList<Supertag>> multiSupertags;
// 	public ArrayList<Integer> wordIDs;
// 	public ArrayList<Integer> postagIDs;
// 	public ArrayList<Category> outputSupertags;
// 	// stored before printing dependency structures
// 
// 	public Sentence(int MAX_WORDS) {
// 		words = new ArrayList<String>(MAX_WORDS);
// 		postags = new ArrayList<String>(MAX_WORDS);
// 		multiSupertags = new ArrayList<ArrayList<Supertag>>(MAX_WORDS);
// 		wordIDs = new ArrayList<Integer>(MAX_WORDS);
// 		postagIDs = new ArrayList<Integer>(MAX_WORDS);
// 		outputSupertags = new ArrayList<Category>(MAX_WORDS);
// 	}
// 
// 	public void addWord(String word) {
// 		words.add(word);
// 	}
// 
// 	public void addPostag(String postag) {
// 		postags.add(postag);
// 	}
// 
// 	public void addSupertags(ArrayList<Supertag> supertags) {
// 		multiSupertags.add(supertags);
// 	}
// 
// 	public void addOutputSupertag(Category supertag) {
// 		outputSupertags.add(supertag);
// 	}
// 
// 	/**
// 	 * Fills wordIDs and postagIDs with integer IDs obtained from lexicon.
// 	 * 
// 	 * @param lexicon lexicon
// 	 */
// 	public void addIDs(Lexicon lexicon) {
// 		for (int i = 0; i < words.size(); i++) {
// 			wordIDs.add(lexicon.getID(words.get(i)));
// 			postagIDs.add(lexicon.getID(postags.get(i)));
// 		}
// 	}
// 
// 	public void clear() {
// 		words.clear();
// 		postags.clear();
// 		multiSupertags.clear();
// 		wordIDs.clear();
// 		postagIDs.clear();
// 		outputSupertags.clear();
// 	}
// 
// 	public void printC_line(PrintWriter out) {
// 		out.print("<c>");
// 
// 		for (int i = 0; i < words.size(); i++) {
// 			out.print(" " + words.get(i) + "|" + postags.get(i) + "|");
// 			out.print(outputSupertags.get(i).toStringNoOuterBracketsNoVars());
// 		}
// 
// 		out.println();
// 	}
// 
// 	public void printSupertags(PrintWriter out) {
// 		for (int i = 0; i < words.size(); i++) {
// 			if (i > 0) {
// 				out.print(" ");
// 			}
// 
// 			out.print(outputSupertags.get(i).toStringNoOuterBracketsNoVars());
// 		}
// 
// 		out.println();
// 	}
// }
// 
// Path: src/lexicon/Relations.java
// public class Relations {
// 	private ArrayList<Relation> relations;
// 	private HashMap<String, Short> relIDs;
// 	private HashMap<CategoryJSlotPair, Short> relIDsII;
// 	// from pairs of Category strings and Julia slots to RelIDs used in the oracle deps decoder
// 	public static short conj1 = 0;
// 	// the special conj relation for dealing with coordination
// 
// 	public Relations() {
// 		relations = new ArrayList<Relation>();
// 		relIDs = new HashMap<String, Short>();
// 		relIDsII = new HashMap<CategoryJSlotPair, Short>();
// 		addRelation("", (short) (0), (short) (0));
// 		// first index of a relation needs to be 1
// 		initConj();
// 	}
// 
// 	public Relation getRelation(short relID) {
// 		return relations.get(relID);
// 	}
// 
// 	public short getRelID(String category, short slot) {
// 		return (short) (relIDs.get(category) + slot - 1);
// 	}
// 
// 	/*
// 	 * note that we may get cases where the category, slot pair is not in the
// 	 * hashMap, eg if the slot is a Julia slot and it doesn't correspond to any
// 	 * of the relations in the markedup file
// 	 */
// 	public short getRelID_II(String category, short slot) {
// 		CategoryJSlotPair pair = new CategoryJSlotPair(category, slot);
// 		if ( relIDsII.containsKey(pair) ) {
// 		// if (relIDsII.get(pair) != null) {
// 			return relIDsII.get(pair);
// 		} else {
// 			return (short) (0); // not a relation in markedup
// 		}
// 	}
// 
// 	public short addRelation(String categoryString, short slot, short juliaSlot) {
// 		Relation relation = new Relation(categoryString, slot, juliaSlot);
// 		short relID = (short) (relations.size());
// 		relations.add(relation);
// 
// 		if ( slot == 1 ) {
// 			relIDs.put(categoryString, relID);
// 			// relID gets converted to an object thro' autoboxing
// 		}
// 
// 		CategoryJSlotPair pair = new CategoryJSlotPair(categoryString, juliaSlot);
// 		relIDsII.put(pair, relID);
// 
// 		return relID;
// 	}
// 
// 	private void initConj() {
// 		conj1 = addRelation("conj", (short) (1), (short) (1));
// 	}
// }


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import io.Sentence;
import lexicon.Relations;
package cat_combination;



/*
 * an object of this class is used by the max F-score oracle decoder;
 * it takes a dependency as input and outputs 1 if the dependency is
 * ignored by the evaluate script; the ignored dependencies are read
 * in as separate text files depending on their type
 */

public class IgnoreDepsEval {
	HashSet<Short> ruleIDs;
	// deps ignored based on the ruleID alone
	HashMap<Short, HashSet<Short>> relRuleIDs;
	// deps ignored based on the relation and ruleID
	HashSet<DependencyStringWords> unfilledDeps;
	// deps ignored based on the relation and head
	HashSet<DependencyStringWords> filledDeps;
	// deps ignored based on the relation, head and filler

// Path: src/io/Sentence.java
// public class Sentence {
// 	public ArrayList<String> words;
// 	public ArrayList<String> postags;
// 	public ArrayList<ArrayList<Supertag>> multiSupertags;
// 	public ArrayList<Integer> wordIDs;
// 	public ArrayList<Integer> postagIDs;
// 	public ArrayList<Category> outputSupertags;
// 	// stored before printing dependency structures
// 
// 	public Sentence(int MAX_WORDS) {
// 		words = new ArrayList<String>(MAX_WORDS);
// 		postags = new ArrayList<String>(MAX_WORDS);
// 		multiSupertags = new ArrayList<ArrayList<Supertag>>(MAX_WORDS);
// 		wordIDs = new ArrayList<Integer>(MAX_WORDS);
// 		postagIDs = new ArrayList<Integer>(MAX_WORDS);
// 		outputSupertags = new ArrayList<Category>(MAX_WORDS);
// 	}
// 
// 	public void addWord(String word) {
// 		words.add(word);
// 	}
// 
// 	public void addPostag(String postag) {
// 		postags.add(postag);
// 	}
// 
// 	public void addSupertags(ArrayList<Supertag> supertags) {
// 		multiSupertags.add(supertags);
// 	}
// 
// 	public void addOutputSupertag(Category supertag) {
// 		outputSupertags.add(supertag);
// 	}
// 
// 	/**
// 	 * Fills wordIDs and postagIDs with integer IDs obtained from lexicon.
// 	 * 
// 	 * @param lexicon lexicon
// 	 */
// 	public void addIDs(Lexicon lexicon) {
// 		for (int i = 0; i < words.size(); i++) {
// 			wordIDs.add(lexicon.getID(words.get(i)));
// 			postagIDs.add(lexicon.getID(postags.get(i)));
// 		}
// 	}
// 
// 	public void clear() {
// 		words.clear();
// 		postags.clear();
// 		multiSupertags.clear();
// 		wordIDs.clear();
// 		postagIDs.clear();
// 		outputSupertags.clear();
// 	}
// 
// 	public void printC_line(PrintWriter out) {
// 		out.print("<c>");
// 
// 		for (int i = 0; i < words.size(); i++) {
// 			out.print(" " + words.get(i) + "|" + postags.get(i) + "|");
// 			out.print(outputSupertags.get(i).toStringNoOuterBracketsNoVars());
// 		}
// 
// 		out.println();
// 	}
// 
// 	public void printSupertags(PrintWriter out) {
// 		for (int i = 0; i < words.size(); i++) {
// 			if (i > 0) {
// 				out.print(" ");
// 			}
// 
// 			out.print(outputSupertags.get(i).toStringNoOuterBracketsNoVars());
// 		}
// 
// 		out.println();
// 	}
// }
// 
// Path: src/lexicon/Relations.java
// public class Relations {
// 	private ArrayList<Relation> relations;
// 	private HashMap<String, Short> relIDs;
// 	private HashMap<CategoryJSlotPair, Short> relIDsII;
// 	// from pairs of Category strings and Julia slots to RelIDs used in the oracle deps decoder
// 	public static short conj1 = 0;
// 	// the special conj relation for dealing with coordination
// 
// 	public Relations() {
// 		relations = new ArrayList<Relation>();
// 		relIDs = new HashMap<String, Short>();
// 		relIDsII = new HashMap<CategoryJSlotPair, Short>();
// 		addRelation("", (short) (0), (short) (0));
// 		// first index of a relation needs to be 1
// 		initConj();
// 	}
// 
// 	public Relation getRelation(short relID) {
// 		return relations.get(relID);
// 	}
// 
// 	public short getRelID(String category, short slot) {
// 		return (short) (relIDs.get(category) + slot - 1);
// 	}
// 
// 	/*
// 	 * note that we may get cases where the category, slot pair is not in the
// 	 * hashMap, eg if the slot is a Julia slot and it doesn't correspond to any
// 	 * of the relations in the markedup file
// 	 */
// 	public short getRelID_II(String category, short slot) {
// 		CategoryJSlotPair pair = new CategoryJSlotPair(category, slot);
// 		if ( relIDsII.containsKey(pair) ) {
// 		// if (relIDsII.get(pair) != null) {
// 			return relIDsII.get(pair);
// 		} else {
// 			return (short) (0); // not a relation in markedup
// 		}
// 	}
// 
// 	public short addRelation(String categoryString, short slot, short juliaSlot) {
// 		Relation relation = new Relation(categoryString, slot, juliaSlot);
// 		short relID = (short) (relations.size());
// 		relations.add(relation);
// 
// 		if ( slot == 1 ) {
// 			relIDs.put(categoryString, relID);
// 			// relID gets converted to an object thro' autoboxing
// 		}
// 
// 		CategoryJSlotPair pair = new CategoryJSlotPair(categoryString, juliaSlot);
// 		relIDsII.put(pair, relID);
// 
// 		return relID;
// 	}
// 
// 	private void initConj() {
// 		conj1 = addRelation("conj", (short) (1), (short) (1));
// 	}
// }


// Path: src/cat_combination/IgnoreDepsEval.java
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import io.Sentence;
import lexicon.Relations;

package cat_combination;



/*
 * an object of this class is used by the max F-score oracle decoder;
 * it takes a dependency as input and outputs 1 if the dependency is
 * ignored by the evaluate script; the ignored dependencies are read
 * in as separate text files depending on their type
 */

public class IgnoreDepsEval {
	HashSet<Short> ruleIDs;
	// deps ignored based on the ruleID alone
	HashMap<Short, HashSet<Short>> relRuleIDs;
	// deps ignored based on the relation and ruleID
	HashSet<DependencyStringWords> unfilledDeps;
	// deps ignored based on the relation and head
	HashSet<DependencyStringWords> filledDeps;
	// deps ignored based on the relation, head and filler

	Relations relations;