Class TLDLParserComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.parsing.tldl.TLDLParserComponent
All Implemented Interfaces:
NLUInterface

public class TLDLParserComponent extends DiarcComponent implements NLUInterface
  • Field Details

    • log

      protected final org.slf4j.Logger log
  • Constructor Details

    • TLDLParserComponent

      public TLDLParserComponent()
  • Method Details

    • shutdownComponent

      protected void shutdownComponent()
      Description copied from class: DiarcComponent
      Any component that needs particular shutdown logic needs to override this method and
      Overrides:
      shutdownComponent in class DiarcComponent
    • 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
    • addDictionary

      public void addDictionary(String newDict)
    • clearDictionary

      public void clearDictionary()
      Replaces current Dictionary with new empty dictionary. Also replaces dictionaryFiles with an empty list/
    • getDictionaryFiles

      public List<String> getDictionaryFiles()
    • getLex

      public org.apache.commons.lang3.tuple.Pair<List<String>,List<String>> getLex()
    • parseUtterance

      public Utterance parseUtterance(Utterance input)
      Description copied from interface: NLUInterface
      Accumulates text, sentence-at-a-time and attempts to parse the incoming Utterance.
      Specified by:
      parseUtterance in interface NLUInterface
      Returns:
      Utterance populated with semantics.
    • setUpdateAddressHistory

      protected void setUpdateAddressHistory(boolean val)
      Used in parser test to toggle updateAddressHistory
      Parameters:
      val - new value
    • getDictionary

      protected Dictionary getDictionary()
      Used by the component test
      Returns:
      dictionary so that things like generateLocationRules can be tested in the parser test
    • injectDictionaryEntry

      public void injectDictionaryEntry(String morpheme, String type, String semantics, String cognitiveStatus)
    • getDictionaryEntries

      public Set<String> getDictionaryEntries()
    • addHomophone

      public void addHomophone(String base, String homophone)
    • addHomophone

      public void addHomophone(String base, String homophone, boolean writeToFile)