edu.ucla.sspace.svs.RelationTuple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sspace-wordsi Show documentation
Show all versions of sspace-wordsi Show documentation
The S-Space Package is a collection of algorithms for building
Semantic Spaces as well as a highly-scalable library for designing new
distributional semantics algorithms. Distributional algorithms process text
corpora and represent the semantic for words as high dimensional feature
vectors. This package also includes matrices, vectors, and numerous
clustering algorithms. These approaches are known by many names, such as
word spaces, semantic spaces, or distributed semantics and rest upon the
Distributional Hypothesis: words that appear in similar contexts have
similar meanings.
The newest version!
package edu.ucla.sspace.svs;
/**
* @author Keith Stevens
*/
public class RelationTuple {
public int head;
public String relation;
public RelationTuple(int head, String relation) {
this.head = head;
this.relation = relation;
}
public boolean equals(Object o) {
if (o == null || !(o instanceof RelationTuple))
return false;
RelationTuple r = (RelationTuple) o;
return this.head == r.head && this.relation == r.relation;
}
public int hashCode() {
return head ^ relation.hashCode();
}
}