// Path: src/main/java/com/asher_stern/crf/crf/filters/Filter.java
// public abstract class Filter<K,G> implements Serializable
// {
// 	private static final long serialVersionUID = 5563671313834518710L;
// 	
// 	public abstract int hashCode();
// 	public abstract boolean equals(Object obj);
// }


import com.asher_stern.crf.crf.filters.Filter;
package com.asher_stern.crf.postagging.postaggers.crf.features;


/**
 * A {@link Filter} for {@link CaseInsensitiveTokenAndTagFeature}.
 * 
 * @author Asher Stern
 * Date: Nov 20, 2014
 *
 */
public class CaseInsensitiveTokenAndTagFilter extends Filter<String, String>
{
	private static final long serialVersionUID = -4114831547683222843L;
	
	public CaseInsensitiveTokenAndTagFilter(String token, String tag)
	{
		super();
		this.token_lowerCase = ( (token==null)?null:token.toLowerCase() );
		this.tag = tag;
	}
	
	
	
	
	@Override
	public int hashCode()
	{
		if (hashCodeCalculated)
		{
			return hashCodeValue;
		}
		else
		{
			final int prime = 31;
			int result = 1;
			result = prime * result + ((tag == null) ? 0 : tag.hashCode());
			result = prime * result
					+ ((token_lowerCase == null) ? 0 : token_lowerCase.hashCode());
			hashCodeValue = result;
			hashCodeCalculated = true;
			return result;
		}
	}
	
	
	@Override
// Path: src/main/java/com/asher_stern/crf/crf/filters/Filter.java
// public abstract class Filter<K,G> implements Serializable
// {
// 	private static final long serialVersionUID = 5563671313834518710L;
// 	
// 	public abstract int hashCode();
// 	public abstract boolean equals(Object obj);
// }


// Path: src/main/java/com/asher_stern/crf/postagging/postaggers/crf/features/CaseInsensitiveTokenAndTagFilter.java
import com.asher_stern.crf.crf.filters.Filter;

package com.asher_stern.crf.postagging.postaggers.crf.features;


/**
 * A {@link Filter} for {@link CaseInsensitiveTokenAndTagFeature}.
 * 
 * @author Asher Stern
 * Date: Nov 20, 2014
 *
 */
public class CaseInsensitiveTokenAndTagFilter extends Filter<String, String>
{
	private static final long serialVersionUID = -4114831547683222843L;
	
	public CaseInsensitiveTokenAndTagFilter(String token, String tag)
	{
		super();
		this.token_lowerCase = ( (token==null)?null:token.toLowerCase() );
		this.tag = tag;
	}
	
	
	
	
	@Override
	public int hashCode()
	{
		if (hashCodeCalculated)
		{
			return hashCodeValue;
		}
		else
		{
			final int prime = 31;
			int result = 1;
			result = prime * result + ((tag == null) ? 0 : tag.hashCode());
			result = prime * result
					+ ((token_lowerCase == null) ? 0 : token_lowerCase.hashCode());
			hashCodeValue = result;
			hashCodeCalculated = true;
			return result;
		}
	}
	
	
	@Override
	public boolean equals(Object obj)