Package edu.tufts.hrilab.slug.common
Class Utterance
java.lang.Object
edu.tufts.hrilab.slug.common.Utterance
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinding
(Map<Variable, Symbol> binding) void
addTranslation
(String language, String translatedWordsAsString) static Utterance
createOutputUtterance
(Symbol speaker, Symbol listener) Convenience method for instantiating Utterance from ASL.boolean
Get actor being addressed.Get bound indirect semantics.Get bound indirect semantics in Predicate form.Get bound semantics.Get bound semantics in Predicate form.Get bound supplemental semantics.Get bound supplemental semantics in Predicate form.Get all actors known to be listeners of the utterance.Get semantic meaning of utterance.Get speaker of the utterance.Get supplemental semantic of utterance.getType()
Get type of utterance.getWords()
Get copy of words list.Get words joined as a single String.int
hashCode()
boolean
boolean
hasWords()
Check if Utterance has words.boolean
Is utterance an input utterance (true) or output utterance (false).boolean
If true, this utterance needs to be validated by a human user before it can be used by the rest of the system.void
setBindings
(List<Map<Variable, Symbol>> bindings) void
setIndirectSemantics
(List<Term> indirectSemantics) void
setLanguage
(String localeCode) void
setNeedsValidation
(boolean validationFlag) Set the needsValidation flag.void
setSemantics
(Symbol semantics) Set the semantic meaning of the utterance.void
setSupplementalSemantics
(List<? extends Term> supplementalSemantics) Set the supplemental semantics of the utterance.void
setType
(UtteranceType type) void
Set words of this Utterance.void
Set the words of this Utterance.toString()
-
Constructor Details
-
Utterance
@Deprecated public Utterance(Symbol speaker, Symbol listener, List<String> words, UtteranceType type, boolean isInput) Deprecated.Use Builder instead of constructor.
-
-
Method Details
-
createOutputUtterance
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
Get speaker of the utterance.- Returns:
-
getAddressee
Get actor being addressed. For now, assumed to be the first listener.- Returns:
-
getListeners
Get all actors known to be listeners of the utterance.- Returns:
-
getSemantics
Get semantic meaning of utterance.- Returns:
-
getSupplementalSemantics
Get supplemental semantic of utterance.- Returns:
-
getType
Get type of utterance. Defined by UtteranceType enum.- Returns:
-
hasWords
public boolean hasWords()Check if Utterance has words.- Returns:
-
getWords
Get copy of words list.- Returns:
-
getWordsAsString
Get words joined as a single String.- Returns:
-
getTierAssignments
-
setType
-
setWords
Set words of this Utterance. The input String will be split on spaces.- Parameters:
words
-
-
setWords
Set the words of this Utterance.- Parameters:
words
-
-
setSemantics
Set the semantic meaning of the utterance.- Parameters:
semantics
-
-
setSupplementalSemantics
Set the supplemental semantics of the utterance.- Parameters:
supplementalSemantics
-
-
getIndirectSemantics
-
setIndirectSemantics
-
addBinding
-
setBindings
-
getBindings
-
getBoundSemantics
Get bound semantics.- Returns:
-
getBoundIndirectSemantics
Get bound indirect semantics.- Returns:
-
getBoundSupplementalSemantics
Get bound supplemental semantics.- Returns:
-
getBoundSemanticsPredicate
Get bound semantics in Predicate form. e.g., semantics(boundOption1, ...)- Returns:
-
getBoundIndirectSemanticsPredicate
Get bound indirect semantics in Predicate form. e.g., indirectSemantics(semantics(boundOption1, ...),semantics(boundOption, ..),...)- Returns:
-
getBoundSupplementalSemanticsPredicate
Get bound supplemental semantics in Predicate form. e.g., suppSemantics(semantics(boundOption1, ...),semantics(boundOption, ..),...)- Returns:
-
hasSingleBinding
public boolean hasSingleBinding() -
addTranslation
-
getTranslations
-
setLanguage
-
getLanguage
-
equals
-
hashCode
public int hashCode() -
toString
-