Class TLDLParserComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.parsing.tldl.TLDLParserComponent
- All Implemented Interfaces:
NLUInterface
-
Field Summary
FieldsFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDictionary(String newDict) voidaddHomophone(String base, String homophone) voidaddHomophone(String base, String homophone, boolean writeToFile) protected List<org.apache.commons.cli.Option>Override this method to define command line options available in sub-class.voidReplaces current Dictionary with new empty dictionary.voidprotected DictionaryUsed by the component testgetLex()protected voidinit()Perform any component initialization.voidinjectDictionaryEntry(String morpheme, String type, String semantics, String cognitiveStatus) protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.parseUtterance(Utterance input) Accumulates text, sentence-at-a-time and attempts to parse the incoming Utterance.protected voidsetUseAddressHistory(boolean val) Used in parser test to toggle updateAddressHistoryprotected voidAny component that needs particular shutdown logic needs to override this method andMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
TLDLParserComponent
public TLDLParserComponent()
-
-
Method Details
-
shutdownComponent
protected void shutdownComponent()Description copied from class:DiarcComponentAny component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponentin classDiarcComponent
-
deregisterDictionary
public void deregisterDictionary() -
init
protected void init()Description copied from class:DiarcComponentPerform 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:
initin classDiarcComponent
-
additionalUsageInfo
Description copied from class:DiarcComponentOverride this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponentOverride this method to parse command line args in the sub-class. Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.- Overrides:
parseArgsin classDiarcComponent
-
addDictionary
-
clearDictionary
public void clearDictionary()Replaces current Dictionary with new empty dictionary. Also replaces dictionaryFiles with an empty list/ -
getDictionaryFiles
-
getLex
-
parseUtterance
Description copied from interface:NLUInterfaceAccumulates text, sentence-at-a-time and attempts to parse the incoming Utterance.- Specified by:
parseUtterancein interfaceNLUInterface- Returns:
- Utterance populated with semantics.
-
setUseAddressHistory
protected void setUseAddressHistory(boolean val) Used in parser test to toggle updateAddressHistory- Parameters:
val- new value
-
getDictionary
Used by the component test- Returns:
- dictionary so that things like generateLocationRules can be tested in the parser test
-
injectDictionaryEntry
-
getDictionaryEntries
-
addHomophone
-
addHomophone
-