Package edu.tufts.hrilab.simspeech
Class SimSpeechRecognitionComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.simspeech.SimSpeechRecognitionComponent
SimSpeechRecognitionComponent
provides a keyboard interface
to replace a speech recognition component. Takes utterances directly from a
text file and sends them to an NLP component.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Logger
protected BufferedReader
boolean
boolean
boolean
boolean
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, shouldRunExecutionLoop
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the SimSpeechRecognitionComponent -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>
Provide additional information for usage...Get the configuration file for input buttons (mostly useful for the visualizer).Get the color specified for text (mostly useful for the visualizer).Get user input from terminal.boolean[]
Get the flags relevant to visualization (mostly useful for the visualizer).protected void
init()
Perform any component initialization.protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Parse additional command-line argumentsvoid
setListener
(Symbol listener) void
setSpeaker
(Symbol speaker) void
Set input text (mostly useful for the visualizer).void
Any 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
-
sbr
-
useUnk
public boolean useUnk -
useCommand
public boolean useCommand -
toLower
public boolean toLower -
useGui
public boolean useGui -
textColor
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
SimSpeechRecognitionComponent
public SimSpeechRecognitionComponent()Constructs the SimSpeechRecognitionComponent
-
-
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 classDiarcComponent
-
getTextColor
Get the color specified for text (mostly useful for the visualizer).- Returns:
- the color text should be displayed in
-
getConfigFile
Get the configuration file for input buttons (mostly useful for the visualizer).- Returns:
- the config file to use
-
getVisFlags
public boolean[] getVisFlags()Get the flags relevant to visualization (mostly useful for the visualizer). Examples include whether to display the command box/button and the "unk" button.- Returns:
- an array of boolean flags
-
setText
Set input text (mostly useful for the visualizer).- Parameters:
in
- the new speech input
-
setSpeaker
-
setListener
-
getUserInput
Get user input from terminal. -
additionalUsageInfo
Provide additional information for usage...- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Parse additional command-line arguments- Overrides:
parseArgs
in classDiarcComponent
-
shutdownComponent
public void shutdownComponent()Description copied from class:DiarcComponent
Any component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponent
in classDiarcComponent
-