Class Utterance

java.lang.Object
edu.tufts.hrilab.slug.common.Utterance
All Implemented Interfaces:
Serializable

public final class Utterance extends Object implements Serializable
An Utterance is used to transmit information between component, including the semantic meaning, the dialogue act, the speaker, and the listener(s).
See Also:
  • Constructor Details

  • Method Details

    • createOutputUtterance

      public static Utterance createOutputUtterance(Symbol speaker, Symbol listener)
      Convenience method for instantiating Utterance from ASL.
      Parameters:
      speaker -
      listener -
      Returns:
    • isInputUtterance

      public boolean isInputUtterance()
      Is utterance an input utterance (true) or output utterance (false).
      Returns:
    • needsValidation

      public boolean needsValidation()
      If true, this utterance needs to be validated by a human user before it can be used by the rest of the system. This is currently for verifying LLM generated parses.
      Returns:
    • setNeedsValidation

      public void setNeedsValidation(boolean validationFlag)
      Set the needsValidation flag.
      Parameters:
      validationFlag -
    • getSpeaker

      public Symbol getSpeaker()
      Get speaker of the utterance.
      Returns:
    • getAddressee

      public Symbol getAddressee()
      Get actor being addressed. For now, assumed to be the first listener.
      Returns:
    • getListeners

      public List<Symbol> getListeners()
      Get all actors known to be listeners of the utterance.
      Returns:
    • getSemantics

      public Symbol getSemantics()
      Get semantic meaning of utterance.
      Returns:
    • getSupplementalSemantics

      public List<Term> getSupplementalSemantics()
      Get supplemental semantic of utterance.
      Returns:
    • getType

      public UtteranceType getType()
      Get type of utterance. Defined by UtteranceType enum.
      Returns:
    • hasWords

      public boolean hasWords()
      Check if Utterance has words.
      Returns:
    • getWords

      public List<String> getWords()
      Get copy of words list.
      Returns:
    • getWordsAsString

      public String getWordsAsString()
      Get words joined as a single String.
      Returns:
    • getTierAssignments

      public Map<Variable,Symbol> getTierAssignments()
    • setType

      public void setType(UtteranceType type)
    • setWords

      public void setWords(String words)
      Set words of this Utterance. The input String will be split on spaces.
      Parameters:
      words -
    • setWords

      public void setWords(List<String> words)
      Set the words of this Utterance.
      Parameters:
      words -
    • setSemantics

      public void setSemantics(Symbol semantics)
      Set the semantic meaning of the utterance.
      Parameters:
      semantics -
    • setSupplementalSemantics

      public void setSupplementalSemantics(List<? extends Term> supplementalSemantics)
      Set the supplemental semantics of the utterance.
      Parameters:
      supplementalSemantics -
    • getIndirectSemantics

      public List<Term> getIndirectSemantics()
    • setIndirectSemantics

      public void setIndirectSemantics(List<Term> indirectSemantics)
    • addBinding

      public void addBinding(Map<Variable,Symbol> binding)
    • setBindings

      public void setBindings(List<Map<Variable,Symbol>> bindings)
    • getBindings

      public List<Map<Variable,Symbol>> getBindings()
    • getBoundSemantics

      public List<Term> getBoundSemantics()
      Get bound semantics.
      Returns:
    • getBoundIndirectSemantics

      public List<List<Term>> getBoundIndirectSemantics()
      Get bound indirect semantics.
      Returns:
    • getBoundSupplementalSemantics

      public List<List<Term>> getBoundSupplementalSemantics()
      Get bound supplemental semantics.
      Returns:
    • getBoundSemanticsPredicate

      public Predicate getBoundSemanticsPredicate()
      Get bound semantics in Predicate form. e.g., semantics(boundOption1, ...)
      Returns:
    • getBoundIndirectSemanticsPredicate

      public Predicate getBoundIndirectSemanticsPredicate()
      Get bound indirect semantics in Predicate form. e.g., indirectSemantics(semantics(boundOption1, ...),semantics(boundOption, ..),...)
      Returns:
    • getBoundSupplementalSemanticsPredicate

      public Predicate getBoundSupplementalSemanticsPredicate()
      Get bound supplemental semantics in Predicate form. e.g., suppSemantics(semantics(boundOption1, ...),semantics(boundOption, ..),...)
      Returns:
    • hasSingleBinding

      public boolean hasSingleBinding()
    • addTranslation

      public void addTranslation(String language, String translatedWordsAsString)
    • getTranslations

      public Map<String,String> getTranslations()
    • setLanguage

      public void setLanguage(String localeCode)
    • getLanguage

      public String getLanguage()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object