Class HybridParserComponent

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

public class HybridParserComponent extends DiarcComponent implements NLUInterface
  • Constructor Details

    • HybridParserComponent

      public HybridParserComponent()
  • Method Details

    • 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
    • init

      public 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
    • parseUtterance

      public Utterance parseUtterance(Utterance incoming)
      Parses the incoming Utterance by delegating to multiple parsers asynchronously and returning the result. Checks the cache first and returns if semantics are present. Parses using TLDL second and returns if semantics are present and parse is not UNKNOWN. Tries the LLMParser last and, if valid uses it and caches it.
      Specified by:
      parseUtterance in interface NLUInterface
      Parameters:
      incoming - The incoming Utterance to parse.
      Returns:
      The parsed Utterance.
    • cacheParse

      public void cacheParse(Utterance utterance)
    • injectDictionaryEntry

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

      public boolean activatePattern(String patternName)