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

it.unitn.disi.smatch.data.ling.Sense Maven / Gradle / Ivy

The newest version!
package it.unitn.disi.smatch.data.ling;

import it.unitn.disi.smatch.oracles.LinguisticOracleException;

import java.util.Collections;
import java.util.List;

/**
 * Default sense implementation.
 *
 * @author 
 */
public abstract class Sense implements ISense {

    String id;

    public Sense(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public String getGloss() {
        return null;
    }

    public List getLemmas() {
        return Collections.emptyList();
    }

    public List getParents() throws LinguisticOracleException {
        return Collections.emptyList();
    }

    public List getParents(int depth) throws LinguisticOracleException {
        return Collections.emptyList();
    }

    public List getChildren() throws LinguisticOracleException {
        return Collections.emptyList();
    }

    public List getChildren(int depth) throws LinguisticOracleException {
        return Collections.emptyList();
    }

    @Override
    public String toString() {
        return id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Sense)) {
            return false;
        }

        Sense sense = (Sense) o;

        if (id != null ? !id.equals(sense.id) : sense.id != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy