edu.cmu.sphinx.decoder
Class Decoder

java.lang.Object
  extended byedu.cmu.sphinx.decoder.Decoder
All Implemented Interfaces:
Configurable

public class Decoder
extends java.lang.Object
implements Configurable

The primary decoder class


Field Summary
static java.lang.String PROP_FEATURE_BLOCK_SIZE
          The sphinx property name for the number of features to recognize at once.
static int PROP_FEATURE_BLOCK_SIZE_DEFAULT
          The default value of the property PROP_FEATURE_BLOCK_SIZE.
static java.lang.String PROP_SEARCH_MANAGER
          The sphinx property name for the name of the search manager to use
 
Constructor Summary
Decoder()
           
 
Method Summary
 void addResultListener(ResultListener resultListener)
          Adds a result listener to this recognizer.
 void allocate()
          Allocate resources necessary for decoding
 void deallocate()
          Deallocate resources
 Result decode(java.lang.String referenceText)
          Decode frames until recognition is complete
 java.lang.String getName()
          Retrieves the name for this configurable component
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 void removeResultListener(ResultListener resultListener)
          Removes a previously added result listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_FEATURE_BLOCK_SIZE

public static final java.lang.String PROP_FEATURE_BLOCK_SIZE
The sphinx property name for the number of features to recognize at once.

See Also:
Constant Field Values

PROP_FEATURE_BLOCK_SIZE_DEFAULT

public static final int PROP_FEATURE_BLOCK_SIZE_DEFAULT
The default value of the property PROP_FEATURE_BLOCK_SIZE.

See Also:
Constant Field Values

PROP_SEARCH_MANAGER

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
Constructor Detail

Decoder

public Decoder()
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

decode

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

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

allocate

public void allocate()
              throws java.io.IOException
Allocate resources necessary for decoding

Throws:
java.io.IOException

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.

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.

Parameters:
resultListener - the listener to remove