Class PragmaticsComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.pragmatics.PragmaticsComponent
All Implemented Interfaces:
PragmaticsInterface

public class PragmaticsComponent extends DiarcComponent implements PragmaticsInterface
  • Field Details

    • log

      protected final org.slf4j.Logger log
    • ruleSets

      protected List<PragRuleProverSet> ruleSets
    • genRuleSets

      protected List<PragRuleProverSet> genRuleSets
    • relevantQueryTerms

      protected Set<Term> relevantQueryTerms
      Relevant query terms collected from all rule sets' environmental context constraints. These only change if the rule sets change.
    • relevantBeliefs

      protected Set<Term> relevantBeliefs
      The set of relevantQueryTerms that have support from Belief. This is updated during each call to pragmatics from an outside component to reflect the latest state of Belief.
    • dialogHistory

      protected List<Utterance> dialogHistory
      The dialogue history from DialogueComponent. This is updated during each call to pragmatics from an outside component to reflect the latest state of Dialogue.
    • pragRulesFiles

      protected List<String> pragRulesFiles
    • genRulesFiles

      protected List<String> genRulesFiles
    • resourceConfigPath

      protected String resourceConfigPath
  • Constructor Details

    • PragmaticsComponent

      public PragmaticsComponent()
  • Method Details

    • init

      protected void init()
      Description copied from class: DiarcComponent
      Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.
      Overrides:
      init in class DiarcComponent
    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      Returns:
    • parseArgs

      protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine)
      Description copied from class: DiarcComponent
      Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs
      Overrides:
      parseArgs in class DiarcComponent
    • loadPragRules

      protected List<PragRuleProverSet> loadPragRules(String path)
    • applyPragmaticMeaning

      public Utterance applyPragmaticMeaning(Utterance utterance)
      Description copied from interface: PragmaticsInterface
      Main entry point for applying pragmatic meaning to both input and output utterances. The rules applied (input prag rules vs prag gen rules) are determined by the information contained in the Utterance instance. INPUT: takes in an Utterance from a parser, perform pragmatic inference on it, and returns the results. OUTPUT: takes in an Utterance from dialogue, perform pragmatic inference on it, and returns the results.
      Specified by:
      applyPragmaticMeaning in interface PragmaticsInterface
      Parameters:
      utterance - utterance whose semantics will undergo pragmatic inference
      Returns:
      utterance with pragmatics applies
    • applyInputPragmaticMeaning

      public void applyInputPragmaticMeaning(Utterance utterance)
    • updateRelevantBeliefs

      protected void updateRelevantBeliefs()
    • getMeaningsInSet

      protected org.apache.commons.lang3.tuple.Pair<Set<Term>,Set<Term>> getMeaningsInSet(PragRuleProverSet prs, Utterance utt, Set<Term> relevantBeliefs, List<Utterance> dialogHistory)
    • updateRelevantBeliefsAndDialogueHistory

      protected void updateRelevantBeliefsAndDialogueHistory()
    • bindMeanings

      protected Set<Term> bindMeanings(Set<Term> terms, Map<Variable,Symbol> bindings)
    • getPragmaticMeanings

      protected org.apache.commons.lang3.tuple.Pair<Set<Term>,Set<Term>> getPragmaticMeanings(Utterance u)
    • getPragmaticMeanings

      protected org.apache.commons.lang3.tuple.Pair<Set<Term>,Set<Term>> getPragmaticMeanings(Utterance u, List<PragRuleProverSet> sets)
    • getRecursedMeanings

      protected org.apache.commons.lang3.tuple.Pair<Set<Term>,Set<Term>> getRecursedMeanings(Utterance u, List<PragRuleProverSet> sets)