edu.cmu.sphinx.decoder
Class AbstractDecoder

java.lang.Object
  extended by edu.cmu.sphinx.decoder.AbstractDecoder
All Implemented Interfaces:
ResultProducer, Configurable
Direct Known Subclasses:
Decoder, FrameDecoder

public abstract class AbstractDecoder
extends java.lang.Object
implements ResultProducer, Configurable

An abstract decoder which implements all functionality which is indpendent of the used decoding-pardigm (pull/push).


Field Summary
static java.lang.String AUTO_ALLOCATE
          If set to true the used search-manager will be automatically allocated in newProperties().
static java.lang.String FIRE_NON_FINAL_RESULTS
          If set to false the used search-manager all registered result listeners will be notified only for final results.
static java.lang.String PROP_RESULT_LISTENERS
           
static java.lang.String PROP_SEARCH_MANAGER
          The sphinx property name for the name of the search manager to use
 
Constructor Summary
AbstractDecoder()
           
 
Method Summary
 void addResultListener(ResultListener resultListener)
          Adds a result listener to this recognizer.
 void allocate()
          Allocate resources necessary for decoding
 void deallocate()
          Deallocate resources
abstract  Result decode(java.lang.String referenceText)
          Decode frames until recognition is complete
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 void removeResultListener(ResultListener resultListener)
          Removes a previously added result listener.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_SEARCH_MANAGER

@S4Component(type=SearchManager.class)
public static final java.lang.String PROP_SEARCH_MANAGER
The sphinx property name for the name of the search manager to use

See Also:
Constant Field Values

PROP_RESULT_LISTENERS

@S4ComponentList(type=ResultListener.class)
public static final java.lang.String PROP_RESULT_LISTENERS
See Also:
Constant Field Values

AUTO_ALLOCATE

@S4Boolean(defaultValue=false)
public static final java.lang.String AUTO_ALLOCATE
If set to true the used search-manager will be automatically allocated in newProperties().

See Also:
Constant Field Values

FIRE_NON_FINAL_RESULTS

@S4Boolean(defaultValue=false)
public static final java.lang.String FIRE_NON_FINAL_RESULTS
If set to false the used search-manager all registered result listeners will be notified only for final results. Per default non-final results don't trigger notification, because in most application the utterance final result will be sufficient.

See Also:
Constant Field Values
Constructor Detail

AbstractDecoder

public AbstractDecoder()
Method Detail

decode

public abstract Result decode(java.lang.String referenceText)
Decode frames until recognition is complete

Parameters:
referenceText - the reference text (or null)
Returns:
a result

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

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.

allocate

public void allocate()
Allocate resources necessary for decoding


deallocate

public void deallocate()
Deallocate resources


addResultListener

public void addResultListener(ResultListener resultListener)
Adds a result listener to this recognizer. A result listener is called whenever a new result is generated by the recognizer. This method can be called in any state.

Specified by:
addResultListener in interface ResultProducer
Parameters:
resultListener - the listener to add

removeResultListener

public void removeResultListener(ResultListener resultListener)
Removes a previously added result listener. This method can be called in any state.

Specified by:
removeResultListener in interface ResultProducer
Parameters:
resultListener - the listener to remove

toString

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