edu.cmu.sphinx.instrumentation
Class SpeedTracker

java.lang.Object
  extended byedu.cmu.sphinx.instrumentation.SpeedTracker
All Implemented Interfaces:
Configurable, java.util.EventListener, Resetable, ResultListener, SignalListener, StateListener

public class SpeedTracker
extends java.lang.Object
implements Configurable, ResultListener, Resetable, StateListener, SignalListener

Monitors a recognizer for speed


Field Summary
static java.lang.String PROP_FRONTEND
          A Sphinx property that defines which frontend to monitor
static java.lang.String PROP_RECOGNIZER
          A Sphinx property that defines which recognizer to monitor
static java.lang.String PROP_SHOW_DETAILS
          A sphinx property that define whether detailed accuracy information is displayed
static boolean PROP_SHOW_DETAILS_DEFAULT
          The default setting of PROP_SHOW_DETAILS
static java.lang.String PROP_SHOW_RESPONSE_TIME
          A sphinx property that define whether detailed response information is displayed
static boolean PROP_SHOW_RESPONSE_TIME_DEFAULT
          The default setting of PROP_SHOW_RESPONSE
static java.lang.String PROP_SHOW_SUMMARY
          A sphinx property that define whether summary accuracy information is displayed
static boolean PROP_SHOW_SUMMARY_DEFAULT
          The default setting of PROP_SHOW_SUMMARY
static java.lang.String PROP_SHOW_TIMERS
          A sphinx property that define whether detailed timer information is displayed
static boolean PROP_SHOW_TIMERS_DEFAULT
          The default setting of PROP_SHOW_DETAILS
 
Constructor Summary
SpeedTracker()
           
 
Method Summary
 float getCumulativeSpeed()
          Returns the cumulative speed of this decoder as a fraction of real time.
 java.lang.String getName()
          Retrieves the name for this configurable component
 float getSpeed()
          Returns the speed of the last decoding as a fraction of real time.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void newResult(Result result)
          Method called when a new result is generated
 void register(java.lang.String name, Registry registry)
          Register my properties.
 void reset()
          Resets the speed statistics
 void signalOccurred(Signal signal)
          Method called when a signal is detected
 void statusChanged(RecognizerState status)
          Called when the status has changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_RECOGNIZER

public static final java.lang.String PROP_RECOGNIZER
A Sphinx property that defines which recognizer to monitor

See Also:
Constant Field Values

PROP_FRONTEND

public static final java.lang.String PROP_FRONTEND
A Sphinx property that defines which frontend to monitor

See Also:
Constant Field Values

PROP_SHOW_SUMMARY

public static final java.lang.String PROP_SHOW_SUMMARY
A sphinx property that define whether summary accuracy information is displayed

See Also:
Constant Field Values

PROP_SHOW_SUMMARY_DEFAULT

public static final boolean PROP_SHOW_SUMMARY_DEFAULT
The default setting of PROP_SHOW_SUMMARY

See Also:
Constant Field Values

PROP_SHOW_DETAILS

public static final java.lang.String PROP_SHOW_DETAILS
A sphinx property that define whether detailed accuracy information is displayed

See Also:
Constant Field Values

PROP_SHOW_DETAILS_DEFAULT

public static final boolean PROP_SHOW_DETAILS_DEFAULT
The default setting of PROP_SHOW_DETAILS

See Also:
Constant Field Values

PROP_SHOW_RESPONSE_TIME

public static final java.lang.String PROP_SHOW_RESPONSE_TIME
A sphinx property that define whether detailed response information is displayed

See Also:
Constant Field Values

PROP_SHOW_RESPONSE_TIME_DEFAULT

public static final boolean PROP_SHOW_RESPONSE_TIME_DEFAULT
The default setting of PROP_SHOW_RESPONSE

See Also:
Constant Field Values

PROP_SHOW_TIMERS

public static final java.lang.String PROP_SHOW_TIMERS
A sphinx property that define whether detailed timer information is displayed

See Also:
Constant Field Values

PROP_SHOW_TIMERS_DEFAULT

public static final boolean PROP_SHOW_TIMERS_DEFAULT
The default setting of PROP_SHOW_DETAILS

See Also:
Constant Field Values
Constructor Detail

SpeedTracker

public SpeedTracker()
Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Parameters:
name - the name of the component
registry - the registry for this component
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

getName

public java.lang.String getName()
Description copied from interface: Configurable
Retrieves the name for this configurable component

Specified by:
getName in interface Configurable
Returns:
the name

newResult

public void newResult(Result result)
Description copied from interface: ResultListener
Method called when a new result is generated

Specified by:
newResult in interface ResultListener
Parameters:
result - the new result

getSpeed

public float getSpeed()
Returns the speed of the last decoding as a fraction of real time.

Returns:
the speed of the last decoding

reset

public void reset()
Resets the speed statistics

Specified by:
reset in interface Resetable

getCumulativeSpeed

public float getCumulativeSpeed()
Returns the cumulative speed of this decoder as a fraction of real time.

Returns:
the cumulative speed of this decoder

signalOccurred

public void signalOccurred(Signal signal)
Description copied from interface: SignalListener
Method called when a signal is detected

Specified by:
signalOccurred in interface SignalListener
Parameters:
signal - the signal

statusChanged

public void statusChanged(RecognizerState status)
Description copied from interface: StateListener
Called when the status has changed.

Specified by:
statusChanged in interface StateListener
Parameters:
status - the new status