edu.cmu.sphinx.research.parallel
Class TokenScorePruner

java.lang.Object
  extended byedu.cmu.sphinx.research.parallel.TokenScorePruner
All Implemented Interfaces:
Configurable, Pruner
Direct Known Subclasses:
CombinedScorePruner, FeatureScorePruner

public abstract class TokenScorePruner
extends java.lang.Object
implements Pruner

Prunes an ActiveList of ParallelTokens based on their scores.


Field Summary
static java.lang.String PROP_ABSOLUTE_BEAM_WIDTH
           
static int PROP_ABSOLUTE_BEAM_WIDTH_DEFAULT
           
static java.lang.String PROP_ACTIVE_LIST_FACTORY
          Sphinx property that defines the name of the active list factory to be used by this search manager.
static java.lang.String PROP_LOG_MATH
          Sphinx property that defines the name of the logmath to be used by this search manager.
static java.lang.String PROP_RELATIVE_BEAM_WIDTH
           
static double PROP_RELATIVE_BEAM_WIDTH_DEFAULT
           
 
Constructor Summary
TokenScorePruner()
           
 
Method Summary
 void allocate()
          Allocates resources necessary for this pruner
 void deallocate()
          Deallocates resources necessary for this pruner
 int getAbsoluteBeamWidth()
          Returns the absolute beam width of this TokenScorePruner.
 java.lang.String getName()
          Retrieves the name for this configurable component
 float getRelativeBeamWidth()
          Returns the relative beam width (in the linear domain) of this TokenScorePruner
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 ActiveList prune(ActiveList activeList)
          Prunes the set of tokens in the given ActiveList.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 void setAbsoluteBeamWidth(int absoluteBeamWidth)
          Sets the absolute beam width of this TokenScorePruner
 void setRelativeBeamWidth(float relativeBeamWidth)
          Sets the relative beam width (log domain) of this TokenScorePruner.
 void startRecognition()
          Starts the pruner
 void stopRecognition()
          Performs post-recognition cleanup.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_ABSOLUTE_BEAM_WIDTH

public static final java.lang.String PROP_ABSOLUTE_BEAM_WIDTH
See Also:
Constant Field Values

PROP_ABSOLUTE_BEAM_WIDTH_DEFAULT

public static final int PROP_ABSOLUTE_BEAM_WIDTH_DEFAULT
See Also:
Constant Field Values

PROP_RELATIVE_BEAM_WIDTH

public static final java.lang.String PROP_RELATIVE_BEAM_WIDTH
See Also:
Constant Field Values

PROP_RELATIVE_BEAM_WIDTH_DEFAULT

public static final double PROP_RELATIVE_BEAM_WIDTH_DEFAULT
See Also:
Constant Field Values

PROP_LOG_MATH

public static final java.lang.String PROP_LOG_MATH
Sphinx property that defines the name of the logmath to be used by this search manager.

See Also:
Constant Field Values

PROP_ACTIVE_LIST_FACTORY

public static final java.lang.String PROP_ACTIVE_LIST_FACTORY
Sphinx property that defines the name of the active list factory to be used by this search manager.

See Also:
Constant Field Values
Constructor Detail

TokenScorePruner

public TokenScorePruner()
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.

prune

public ActiveList prune(ActiveList activeList)
Prunes the set of tokens in the given ActiveList. It is assumed that all token in the ActiveList are ParallelTokens. Pruning is performed according to the absolute and relative beam widths of the given ActiveList.

Specified by:
prune in interface Pruner
Parameters:
activeList - a activeList of tokens
Returns:
the pruned list, (may be the sample list as stateTokenList)

getAbsoluteBeamWidth

public int getAbsoluteBeamWidth()
Returns the absolute beam width of this TokenScorePruner.

Returns:
the absolute beam width (in the linear domain)

setAbsoluteBeamWidth

public void setAbsoluteBeamWidth(int absoluteBeamWidth)
Sets the absolute beam width of this TokenScorePruner

Parameters:
absoluteBeamWidth - the absolute beam width

getRelativeBeamWidth

public float getRelativeBeamWidth()
Returns the relative beam width (in the linear domain) of this TokenScorePruner

Returns:
the relative beam width (in the linear domain)

setRelativeBeamWidth

public void setRelativeBeamWidth(float relativeBeamWidth)
Sets the relative beam width (log domain) of this TokenScorePruner.

Parameters:
relativeBeamWidth - the relative beam width in log domain

startRecognition

public void startRecognition()
Starts the pruner

Specified by:
startRecognition in interface Pruner

stopRecognition

public void stopRecognition()
Performs post-recognition cleanup.

Specified by:
stopRecognition in interface Pruner

allocate

public void allocate()
Allocates resources necessary for this pruner

Specified by:
allocate in interface Pruner

deallocate

public void deallocate()
Deallocates resources necessary for this pruner

Specified by:
deallocate in interface Pruner

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