edu.cmu.sphinx.decoder.search
Class SimpleBreadthFirstSearchManager

java.lang.Object
  extended by edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager
All Implemented Interfaces:
SearchManager, Configurable

public class SimpleBreadthFirstSearchManager
extends java.lang.Object
implements SearchManager

Provides the breadth first search. To perform recognition an application should call initialize before recognition begins, and repeatedly call recognize until Result.isFinal() returns true. Once a final result has been obtained, terminate should be called.

All scores and probabilities are maintained in the log math log domain.

For information about breadth first search please refer to "Spoken Language Processing", X. Huang, PTR


Field Summary
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_GROW_SKIP_INTERVAL
          A sphinx property that controls the number of frames processed for every time the decode growth step is skipped.
static java.lang.String PROP_LINGUIST
          Sphinx property that defines the name of the linguist 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_PRUNER
          Sphinx property that defines the name of the linguist to be used by this search manager.
static java.lang.String PROP_RELATIVE_WORD_BEAM_WIDTH
          Property that sets the minimum score relative to the maximum score in the word list for pruning.
static java.lang.String PROP_SCORER
          Sphinx property that defines the name of the scorer to be used by this search manager.
static java.lang.String PROP_SHOW_TOKEN_COUNT
          A sphinx property than, when set to true will cause the recognizer to count up all the tokens in the active list after every frame.
static java.lang.String PROP_WANT_ENTRY_PRUNING
          A sphinx property that controls whether or not relative beam pruning will be performed on the entry into a state.
 
Constructor Summary
SimpleBreadthFirstSearchManager()
           
 
Method Summary
 void allocate()
          Allocates the resources necessary for this search.
 void deallocate()
          Deallocates resources necessary for this search.
 ActiveList getActiveList()
           
 int getCurrentFrameNumber()
          Returns the current frame number.
 Timer getGrowTimer()
          Returns the Timer for growing.
 java.util.List<Token> getResultList()
          Returns the result list.
 StatisticsVariable getTokensCreated()
          Returns the tokensCreated StatisticsVariable.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 Result recognize(int nFrames)
          Performs the recognition for the given number of frames.
 void startRecognition()
          Called at the start of recognition.
 void stopRecognition()
          Terminates a recognition
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_LINGUIST

@S4Component(type=Linguist.class)
public static final java.lang.String PROP_LINGUIST
Sphinx property that defines the name of the linguist to be used by this search manager.

See Also:
Constant Field Values

PROP_PRUNER

@S4Component(type=Pruner.class)
public static final java.lang.String PROP_PRUNER
Sphinx property that defines the name of the linguist to be used by this search manager.

See Also:
Constant Field Values

PROP_SCORER

@S4Component(type=AcousticScorer.class)
public static final java.lang.String PROP_SCORER
Sphinx property that defines the name of the scorer to be used by this search manager.

See Also:
Constant Field Values

PROP_LOG_MATH

@S4Component(type=LogMath.class)
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

@S4Component(type=ActiveListFactory.class)
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

PROP_SHOW_TOKEN_COUNT

@S4Boolean(defaultValue=false)
public static final java.lang.String PROP_SHOW_TOKEN_COUNT
A sphinx property than, when set to true will cause the recognizer to count up all the tokens in the active list after every frame.

See Also:
Constant Field Values

PROP_RELATIVE_WORD_BEAM_WIDTH

@S4Double(defaultValue=0.0)
public static final java.lang.String PROP_RELATIVE_WORD_BEAM_WIDTH
Property that sets the minimum score relative to the maximum score in the word list for pruning. Words with a score less than relativeBeamWidth * maximumScore will be pruned from the list

See Also:
Constant Field Values

PROP_WANT_ENTRY_PRUNING

@S4Boolean(defaultValue=false)
public static final java.lang.String PROP_WANT_ENTRY_PRUNING
A sphinx property that controls whether or not relative beam pruning will be performed on the entry into a state.

See Also:
Constant Field Values

PROP_GROW_SKIP_INTERVAL

@S4Integer(defaultValue=0)
public static final java.lang.String PROP_GROW_SKIP_INTERVAL
A sphinx property that controls the number of frames processed for every time the decode growth step is skipped. Setting this property to zero disables grow skipping. Setting this number to a small integer will increase the speed of the decoder but will also decrease its accuracy. The higher the number, the less often the grow code is skipped.

See Also:
Constant Field Values
Constructor Detail

SimpleBreadthFirstSearchManager

public SimpleBreadthFirstSearchManager()
Method Detail

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.

startRecognition

public void startRecognition()
Called at the start of recognition. Gets the search manager ready to recognize

Specified by:
startRecognition in interface SearchManager

recognize

public Result recognize(int nFrames)
Performs the recognition for the given number of frames.

Specified by:
recognize in interface SearchManager
Parameters:
nFrames - the number of frames to recognize
Returns:
the current result or null if there is no Result (due to the lack of frames to recognize)

stopRecognition

public void stopRecognition()
Terminates a recognition

Specified by:
stopRecognition in interface SearchManager

getActiveList

public ActiveList getActiveList()

getResultList

public java.util.List<Token> getResultList()
Returns the result list.

Returns:
the result list

getCurrentFrameNumber

public int getCurrentFrameNumber()
Returns the current frame number.

Returns:
the current frame number

getGrowTimer

public Timer getGrowTimer()
Returns the Timer for growing.

Returns:
the Timer for growing

getTokensCreated

public StatisticsVariable getTokensCreated()
Returns the tokensCreated StatisticsVariable.

Returns:
the tokensCreated StatisticsVariable.

allocate

public void allocate()
Description copied from interface: SearchManager
Allocates the resources necessary for this search. This should be called once before an recognitions are performed

Specified by:
allocate in interface SearchManager

deallocate

public void deallocate()
Description copied from interface: SearchManager
Deallocates resources necessary for this search. This should be called once after all recognitions are completed at the search manager is no longer needed.

Specified by:
deallocate in interface SearchManager

toString

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