All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.berkeley.nlp.classify.Feature Maven / Gradle / Ivy

Go to download

The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).

The newest version!
package edu.berkeley.nlp.classify;


public class Feature  {
	
	private Object obj ;
	private int index ;
	
	public Feature(Object obj, int index) {
		this.obj = obj;
		this.index = index;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((obj == null) ? 0 : obj.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Feature other = (Feature) obj;
		if (this.obj == null) {
			if (other.obj != null)
				return false;
		} else if (!this.obj.equals(other.obj))
			return false;
		return true;
	}

	public String toString() {
		return obj.toString();
	}
	
	public int getIndex() {
		return index;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy