// Path: src/edu/smu/tspell/wordnet/SynsetType.java
// public class SynsetType implements Comparable
// {
// 
// 	/**
// 	 * Noun synset code.
// 	 */
// 	private final static int CODE_NOUN                = 1;
// 
// 	/**
// 	 * Verb synset code.
// 	 */
// 	private final static int CODE_VERB                = 2;
// 
// 	/**
// 	 * Adjective synset code.
// 	 */
// 	private final static int CODE_ADJECTIVE           = 3;
// 
// 	/**
// 	 * Adverb synset code.
// 	 */
// 	private final static int CODE_ADVERB              = 4;
// 
// 	/**
// 	 * Adjective satellite synset code.
// 	 */
// 	private final static int CODE_ADJECTIVE_SATELLITE = 5;
// 
// 	/**
// 	 * Noun category.
// 	 */
// 	public final static SynsetType NOUN = new SynsetType(CODE_NOUN);
// 
// 	/**
// 	 * Verb category.
// 	 */
// 	public final static SynsetType VERB = new SynsetType(CODE_VERB);
// 
// 	/**
// 	 * Adjective category.
// 	 */
// 	public final static SynsetType ADJECTIVE = new SynsetType(CODE_ADJECTIVE);
// 
// 	/**
// 	 * Adverb category.
// 	 */
// 	public final static SynsetType ADVERB = new SynsetType(CODE_ADVERB);
// 
// 	/**
// 	 * Adjective satellite category.
// 	 */
// 	public final static SynsetType ADJECTIVE_SATELLITE =
// 			new SynsetType(CODE_ADJECTIVE_SATELLITE);
// 
// 	/**
// 	 * Array containing all category types.
// 	 */
// 	public final static SynsetType[] ALL_TYPES =
// 			{NOUN, VERB, ADJECTIVE, ADVERB, ADJECTIVE_SATELLITE};
// 
// 	/**
// 	 * The numeric code used to represent a category.
// 	 */
// 	private int code;
// 
// 	/**
// 	 * Accepts a category code.
// 	 * 
// 	 * @param  code Value used to represent this category.
// 	 */
// 	private SynsetType(int code)
// 	{
// 		this.code = code;
// 	}
// 
// 	/**
// 	 * Returns the code associated with this category.
// 	 * 
// 	 * @return Code that's associated with this category.
// 	 */
// 	public int getCode()
// 	{
// 		return code;
// 	}
// 
// 	/**
// 	 * Compares this object to another one to determine their relative order.
// 	 * 
// 	 * @param  o The reference object with which to compare.
// 	 * @return A negative, zero, or positive value if this object is less
// 	 *         than, equal to, or greater than the reference object,
// 	 *         respectively.
// 	 */
// 	public int compareTo(Object o)
// 	{
// 		int relativeValue = 1;
// 		if (o != null)
// 		{
// 			SynsetType target = (SynsetType)o;
// 			relativeValue = this.getCode() - target.getCode();
// 		}
// 		return relativeValue;
// 	}
// 
// 	/**
// 	 * Returns a hash code for the object.
// 	 * 
// 	 * @return Returns the numeric code associated with this instance.
// 	 */
// 	public int hashCode()
// 	{
// 		return getCode();
// 	}
// 
// 	/**
// 	 * Indicates whether some object is "equal to" this one.
// 	 * 
// 	 * @param  o The reference object with which to compare.
// 	 * @return <code>true</code> if this object is "equal to" the reference
// 	 *         one; <code>false</code> otherwise.
// 	 */
// 	public boolean equals(Object o)
// 	{
// 		boolean isEqual = false;
// 		if ((o != null) && (o instanceof SynsetType))
// 		{
// 			SynsetType reference = (SynsetType)o;
// 			isEqual = (this.getCode() == reference.getCode());
// 		}
// 		return isEqual;
// 	}
// 
// 	/**
// 	 * Returns a string representation of this object.
// 	 * 
// 	 * @return String representation of this object.
// 	 */
// 	public String toString()
// 	{
// 		return Integer.toString(getCode());
// 	}
// 
// }


import edu.smu.tspell.wordnet.SynsetType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
	{
		if (instance == null)
		{
			instance = new DetachmentRules();
		}
		return instance;
	}

	/**
	 * This constructor ensures that instances of this class can't be
	 * constructed by other classes.
	 */
	private DetachmentRules()
	{
		super();
	}

	/**
	 * Returns "candidate" root forms of a possibly inflected word form.
	 * In other words, given a word form that may be inflected (e.g., the
	 * plural "airplanes") and that isn't found in that form in WordNet,
	 * this method returns potential variations (e.g., "airplane") that
	 * might be successfully retrieved instead.
	 * 
	 * @param  inflection Possibly inflected word form for which to return
	 *         root candidates.
	 * @param  type Type of synset for which to apply the morphology rules.
	 * @return Variations on the specified word form that may represent a
	 *         valid root.
	 */
// Path: src/edu/smu/tspell/wordnet/SynsetType.java
// public class SynsetType implements Comparable
// {
// 
// 	/**
// 	 * Noun synset code.
// 	 */
// 	private final static int CODE_NOUN                = 1;
// 
// 	/**
// 	 * Verb synset code.
// 	 */
// 	private final static int CODE_VERB                = 2;
// 
// 	/**
// 	 * Adjective synset code.
// 	 */
// 	private final static int CODE_ADJECTIVE           = 3;
// 
// 	/**
// 	 * Adverb synset code.
// 	 */
// 	private final static int CODE_ADVERB              = 4;
// 
// 	/**
// 	 * Adjective satellite synset code.
// 	 */
// 	private final static int CODE_ADJECTIVE_SATELLITE = 5;
// 
// 	/**
// 	 * Noun category.
// 	 */
// 	public final static SynsetType NOUN = new SynsetType(CODE_NOUN);
// 
// 	/**
// 	 * Verb category.
// 	 */
// 	public final static SynsetType VERB = new SynsetType(CODE_VERB);
// 
// 	/**
// 	 * Adjective category.
// 	 */
// 	public final static SynsetType ADJECTIVE = new SynsetType(CODE_ADJECTIVE);
// 
// 	/**
// 	 * Adverb category.
// 	 */
// 	public final static SynsetType ADVERB = new SynsetType(CODE_ADVERB);
// 
// 	/**
// 	 * Adjective satellite category.
// 	 */
// 	public final static SynsetType ADJECTIVE_SATELLITE =
// 			new SynsetType(CODE_ADJECTIVE_SATELLITE);
// 
// 	/**
// 	 * Array containing all category types.
// 	 */
// 	public final static SynsetType[] ALL_TYPES =
// 			{NOUN, VERB, ADJECTIVE, ADVERB, ADJECTIVE_SATELLITE};
// 
// 	/**
// 	 * The numeric code used to represent a category.
// 	 */
// 	private int code;
// 
// 	/**
// 	 * Accepts a category code.
// 	 * 
// 	 * @param  code Value used to represent this category.
// 	 */
// 	private SynsetType(int code)
// 	{
// 		this.code = code;
// 	}
// 
// 	/**
// 	 * Returns the code associated with this category.
// 	 * 
// 	 * @return Code that's associated with this category.
// 	 */
// 	public int getCode()
// 	{
// 		return code;
// 	}
// 
// 	/**
// 	 * Compares this object to another one to determine their relative order.
// 	 * 
// 	 * @param  o The reference object with which to compare.
// 	 * @return A negative, zero, or positive value if this object is less
// 	 *         than, equal to, or greater than the reference object,
// 	 *         respectively.
// 	 */
// 	public int compareTo(Object o)
// 	{
// 		int relativeValue = 1;
// 		if (o != null)
// 		{
// 			SynsetType target = (SynsetType)o;
// 			relativeValue = this.getCode() - target.getCode();
// 		}
// 		return relativeValue;
// 	}
// 
// 	/**
// 	 * Returns a hash code for the object.
// 	 * 
// 	 * @return Returns the numeric code associated with this instance.
// 	 */
// 	public int hashCode()
// 	{
// 		return getCode();
// 	}
// 
// 	/**
// 	 * Indicates whether some object is "equal to" this one.
// 	 * 
// 	 * @param  o The reference object with which to compare.
// 	 * @return <code>true</code> if this object is "equal to" the reference
// 	 *         one; <code>false</code> otherwise.
// 	 */
// 	public boolean equals(Object o)
// 	{
// 		boolean isEqual = false;
// 		if ((o != null) && (o instanceof SynsetType))
// 		{
// 			SynsetType reference = (SynsetType)o;
// 			isEqual = (this.getCode() == reference.getCode());
// 		}
// 		return isEqual;
// 	}
// 
// 	/**
// 	 * Returns a string representation of this object.
// 	 * 
// 	 * @return String representation of this object.
// 	 */
// 	public String toString()
// 	{
// 		return Integer.toString(getCode());
// 	}
// 
// }


// Path: src/edu/smu/tspell/wordnet/impl/file/DetachmentRules.java
import edu.smu.tspell.wordnet.SynsetType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

	{
		if (instance == null)
		{
			instance = new DetachmentRules();
		}
		return instance;
	}

	/**
	 * This constructor ensures that instances of this class can't be
	 * constructed by other classes.
	 */
	private DetachmentRules()
	{
		super();
	}

	/**
	 * Returns "candidate" root forms of a possibly inflected word form.
	 * In other words, given a word form that may be inflected (e.g., the
	 * plural "airplanes") and that isn't found in that form in WordNet,
	 * this method returns potential variations (e.g., "airplane") that
	 * might be successfully retrieved instead.
	 * 
	 * @param  inflection Possibly inflected word form for which to return
	 *         root candidates.
	 * @param  type Type of synset for which to apply the morphology rules.
	 * @return Variations on the specified word form that may represent a
	 *         valid root.
	 */
	public String[] getCandidateForms(String inflection, SynsetType type)