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

edu.ucla.sspace.svs.RelationTuple Maven / Gradle / Ivy

Go to download

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy