demo.inpro.system.greifarm
Class WordAdaptiveSmoothingDeltifier

java.lang.Object
  extended by inpro.incremental.deltifier.ASRWordDeltifier
      extended by inpro.incremental.deltifier.SmoothingDeltifier
          extended by demo.inpro.system.greifarm.WordAdaptiveSmoothingDeltifier
All Implemented Interfaces:
edu.cmu.sphinx.frontend.SignalListener, edu.cmu.sphinx.instrumentation.Resetable, edu.cmu.sphinx.util.props.Configurable, ASRResultKeeper

public class WordAdaptiveSmoothingDeltifier
extends SmoothingDeltifier

TODO/possible extensions: - make incremental smoothing depend on currently salient actions (left is more likely after left, stop is more likely while moving)


Nested Class Summary
 
Nested classes/interfaces inherited from class inpro.incremental.deltifier.SmoothingDeltifier
SmoothingDeltifier.SmoothingCounter
 
Field Summary
static java.lang.String PROP_SAFE_WORDS
           
static java.lang.String PROP_URGENT_WORD
           
 java.util.List<java.lang.String> safeWords
           
 java.lang.String urgentWord
           
 
Fields inherited from class inpro.incremental.deltifier.SmoothingDeltifier
PROP_SMOOTHING, smoothing, smoothingQueue
 
Fields inherited from class inpro.incremental.deltifier.ASRWordDeltifier
recoFinal, wordEdits, wordIUs
 
Constructor Summary
WordAdaptiveSmoothingDeltifier()
           
 
Method Summary
private  void applyEditsToOutputLists(java.util.List<EditMessage<WordIU>> editsToBeApplied)
          apply edits to the output lists (wordIUs and wordEdits)
protected  void applySmoothingQueueToOutputWords()
          apply edits from smoothingQueue if their counter has run out, add them to edit list and update wordIUs in contrast to the overridden operation, this looks at *all* enqueued items (but stopping if it reaches a stay-safe-word), and if a counter has run out it enqueues also words preceding this word, for which the counter has not run out.
private  java.util.List<EditMessage<WordIU>> determineEditsToBeApplied(java.util.ListIterator<SmoothingDeltifier.SmoothingCounter> smoothIter)
          determine the edits from the smoothingQueue that should be applied if a counter has run out
protected  int getSmoothingFactor(EditMessage<WordIU> edit)
          more interesting assignment of smoothing factors depending on whether something is an "urgent word", a "stay-safe word", or just any other word
protected  boolean isStaySafeWord(EditMessage<WordIU> edit)
          determines the edits that should get a high safety-threshold words with action:drop should get a high smoothing factor,
protected  boolean isUrgentWord(EditMessage<WordIU> edit)
          determines the words that should be handled with priority words with action:stop should get a very low smoothing factor for the ADD message
static void main(java.lang.String[] args)
          only for testing
 void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
          this base implementation does not accept any parameters
 java.lang.String toString()
           
 
Methods inherited from class inpro.incremental.deltifier.SmoothingDeltifier
basicDeltify, deltify, handleIncomingIUEdits, restoreOutputLists, saveOutputLists
 
Methods inherited from class inpro.incremental.deltifier.ASRWordDeltifier
deltify, getCurrentFrame, getCurrentTime, getTokens, getWordEdits, getWordIUs, reset, setCollectTime, setOffset, signalOccurred
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_SAFE_WORDS

@S4String(defaultValue="drop")
public static final java.lang.String PROP_SAFE_WORDS
See Also:
Constant Field Values

safeWords

public java.util.List<java.lang.String> safeWords

PROP_URGENT_WORD

@S4String(defaultValue="stop")
public static final java.lang.String PROP_URGENT_WORD
See Also:
Constant Field Values

urgentWord

public java.lang.String urgentWord
Constructor Detail

WordAdaptiveSmoothingDeltifier

public WordAdaptiveSmoothingDeltifier()
Method Detail

newProperties

public void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
                   throws edu.cmu.sphinx.util.props.PropertyException
Description copied from class: ASRWordDeltifier
this base implementation does not accept any parameters

Specified by:
newProperties in interface edu.cmu.sphinx.util.props.Configurable
Overrides:
newProperties in class SmoothingDeltifier
Throws:
edu.cmu.sphinx.util.props.PropertyException

getSmoothingFactor

protected int getSmoothingFactor(EditMessage<WordIU> edit)
more interesting assignment of smoothing factors depending on whether something is an "urgent word", a "stay-safe word", or just any other word

Overrides:
getSmoothingFactor in class SmoothingDeltifier
Parameters:
edit - ignored in this implementation
Returns:
smoothing factor for this edit; constant in this implementation

isStaySafeWord

protected boolean isStaySafeWord(EditMessage<WordIU> edit)
determines the edits that should get a high safety-threshold words with action:drop should get a high smoothing factor,


isUrgentWord

protected boolean isUrgentWord(EditMessage<WordIU> edit)
determines the words that should be handled with priority words with action:stop should get a very low smoothing factor for the ADD message


applySmoothingQueueToOutputWords

protected void applySmoothingQueueToOutputWords()
apply edits from smoothingQueue if their counter has run out, add them to edit list and update wordIUs

in contrast to the overridden operation, this looks at *all* enqueued items (but stopping if it reaches a stay-safe-word), and if a counter has run out it enqueues also words preceding this word, for which the counter has not run out. in other words: "jetzt stop" will be released as soon as "stop" goes off, even though "jetzt" may not have gone off yet.

Overrides:
applySmoothingQueueToOutputWords in class SmoothingDeltifier

determineEditsToBeApplied

private java.util.List<EditMessage<WordIU>> determineEditsToBeApplied(java.util.ListIterator<SmoothingDeltifier.SmoothingCounter> smoothIter)
determine the edits from the smoothingQueue that should be applied if a counter has run out

Parameters:
smoothIter -
Returns:
all the items in the smoothingQueue that *precede* the item for which the counter has run out (including that item)

applyEditsToOutputLists

private void applyEditsToOutputLists(java.util.List<EditMessage<WordIU>> editsToBeApplied)
apply edits to the output lists (wordIUs and wordEdits)

Parameters:
editsToBeApplied -

main

public static void main(java.lang.String[] args)
only for testing


toString

public java.lang.String toString()
Overrides:
toString in class SmoothingDeltifier