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

edu.cmu.sv.system_action.SystemAction 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.system_action;

import edu.cmu.sv.system_action.dialog_act.DialogAct;
import edu.cmu.sv.system_action.non_dialog_task.NonDialogTask;

/**
 * Created by David Cohen on 9/11/14.
 */
public abstract class SystemAction {
    public boolean evaluationMatch(SystemAction other){
        if (!this.getClass().equals(other.getClass()))
            return false;
        if (this instanceof DialogAct) {
            DialogAct da1 = (DialogAct) this;
            DialogAct da2 = (DialogAct) other;
            for (String key : da1.getIndividualParameters().keySet()){
                if (!da1.getBoundIndividuals().get(key).equals(da2.getBoundIndividuals().get(key)))
                    return false;
            }
            for (String key : da1.getClassParameters().keySet()){
                if (!da1.getBoundClasses().get(key).equals(da2.getBoundClasses().get(key)))
                    return false;
            }
            for (String key : da1.getDescriptionParameters().keySet()){
                if (!da1.getBoundDescriptions().get(key).equals(da2.getBoundDescriptions().get(key)))
                    return false;
            }
            for (String key : da1.getPathParameters().keySet()){
                if (!da1.getBoundPaths().get(key).equals(da2.getBoundPaths().get(key)))
                    return false;
            }
            return true;
        }
        if (this instanceof NonDialogTask)
            return ((NonDialogTask) this).getTaskSpec().equals(((NonDialogTask) other).getTaskSpec());
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy