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

edu.cmu.sv.domain.ontology.Role Maven / Gradle / Ivy

Go to download

A library that allows rapid prototyping of dialog systems (language understanding, discourse modelling, dialog management, language generation).

There is a newer version: 0.7.0
Show newest version
package edu.cmu.sv.domain.ontology;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by David Cohen on 6/15/15.
 */
public class Role {
    public boolean isQualityRole;
    public boolean isInverseRole;
    public String name;
    public Set domain = new HashSet<>();
    public Set range = new HashSet<>();

    public Set getDomain() {
        return domain;
    }

    public Set getRange() {
        return range;
    }

    public Role(String name, boolean isQualityRole, boolean isInverseRole) {
        this.name = name;
        this.domain.addAll(domain);
        this.range.addAll(range);
        this.isQualityRole = isQualityRole;
        this.isInverseRole = isInverseRole;
    }

    public String getQualityName(){
        if (!isQualityRole)
            throw new Error("Can't get quality name for a role that isn't a quality role:"+name);
        if (isInverseRole)
            return name.substring("InverseHas".length());
        else
            return name.substring("Has".length());
    }
}