edu.cmu.sphinx.decoder.search
Class WordPruningBreadthFirstSearchManager

java.lang.Object
  extended byedu.cmu.sphinx.decoder.search.WordPruningBreadthFirstSearchManager
All Implemented Interfaces:
Configurable, SearchManager

public class WordPruningBreadthFirstSearchManager
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.


Field Summary
static java.lang.String PROP_ACOUSTIC_LOOKAHEAD_FRAMES
          A sphinx property that controls the amount of simple acoustic lookahead performed.
static float PROP_ACOUSTIC_LOOKAHEAD_FRAMES_DEFAULT
          The default value for the PROP_ACOUSTIC_LOOKAHEAD_FRAMES property.
static java.lang.String PROP_ACTIVE_LIST_MANAGER
          Sphinx property that defines the type of active list to use
static java.lang.String PROP_BUILD_WORD_LATTICE
          Sphinx property that specifies whether to build a word lattice.
static boolean PROP_BUILD_WORD_LATTICE_DEFAULT
          The default value of the PROP_BUILD_WORD_LATTICE property.
static java.lang.String PROP_CHECK_STATE_ORDER
          Sphinx property for checking if the order of states is valid.
static boolean PROP_CHECK_STATE_ORDER_DEFAULT
          The default value of the PROP_CHECK_STATE_ORDER property.
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 int PROP_GROW_SKIP_INTERVAL_DEFAULT
          The default value for the PROP_GROW_SKIP_INTERVAL property.
static java.lang.String PROP_KEEP_ALL_TOKENS
          A sphinx property that controls whether or not we keep all tokens.
static boolean PROP_KEEP_ALL_TOKENS_DEFAULT
          The default value for the PROP_ACOUSTIC_LOOKAHEAD_FRAMES property.
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_MAX_LATTICE_EDGES
          Sphinx property that specifies the maximum lattice edges
static int PROP_MAX_LATTICE_EDGES_DEFAULT
          The default value of the PROP_MAX_LATTICE_EDGES property.
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_BEAM_WIDTH
          Sphinx4 property that specifies the relative beam width
static float PROP_RELATIVE_BEAM_WIDTH_DEFAULT
          Sphinx4 property that specifies the default value for the relative beam width
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 boolean PROP_SHOW_TOKEN_COUNT_DEFAULT
          The default value for the PROP_SHOW_TOKEN_COUNT property
static boolean PROP_WANT_ENTRY_PRUNING_DEFAULT
          The default value for the PROP_WANT_ENTRY_PRUNING property
 
Constructor Summary
WordPruningBreadthFirstSearchManager()
           
 
Method Summary
 void allocate()
          Allocates the resources necessary for this search.
 void deallocate()
          Deallocates resources necessary for this search.
 AcousticScorer getAcousticScorer()
          Returns the AcousticScorer.
 ActiveList getActiveList()
          Returns the ActiveList.
 int getCurrentFrameNumber()
          Returns the current frame number.
 Timer getGrowTimer()
          Returns the Timer for growing.
 Linguist getLinguist()
          Returns the Linguist.
 LogMath getLogMath()
          Returns the LogMath used.
 java.lang.String getName()
          Retrieves the name for this configurable component
 Pruner getPruner()
          Returns the Pruner.
 java.util.List getResultList()
          Returns the result list.
 StatisticsVariable getTokensCreated()
          Returns the tokensCreated StatisticsVariable.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 Result recognize(int nFrames)
          Performs the recognition for the given number of frames.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 void setActiveList(ActiveList activeList)
          Sets the ActiveList.
 void setResultList(java.util.List resultList)
          Sets the result list.
 void startRecognition()
          Called at the start of recognition.
 void stopRecognition()
          Terminates a recognition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_LINGUIST

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

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

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

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_SHOW_TOKEN_COUNT

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_SHOW_TOKEN_COUNT_DEFAULT

public static final boolean PROP_SHOW_TOKEN_COUNT_DEFAULT
The default value for the PROP_SHOW_TOKEN_COUNT property

See Also:
Constant Field Values

PROP_WANT_ENTRY_PRUNING_DEFAULT

public static final boolean PROP_WANT_ENTRY_PRUNING_DEFAULT
The default value for the PROP_WANT_ENTRY_PRUNING property

See Also:
Constant Field Values

PROP_GROW_SKIP_INTERVAL

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

PROP_GROW_SKIP_INTERVAL_DEFAULT

public static final int PROP_GROW_SKIP_INTERVAL_DEFAULT
The default value for the PROP_GROW_SKIP_INTERVAL property.

See Also:
Constant Field Values

PROP_ACTIVE_LIST_MANAGER

public static final java.lang.String PROP_ACTIVE_LIST_MANAGER
Sphinx property that defines the type of active list to use

See Also:
Constant Field Values

PROP_CHECK_STATE_ORDER

public static final java.lang.String PROP_CHECK_STATE_ORDER
Sphinx property for checking if the order of states is valid.

See Also:
Constant Field Values

PROP_CHECK_STATE_ORDER_DEFAULT

public static final boolean PROP_CHECK_STATE_ORDER_DEFAULT
The default value of the PROP_CHECK_STATE_ORDER property.

See Also:
Constant Field Values

PROP_BUILD_WORD_LATTICE

public static final java.lang.String PROP_BUILD_WORD_LATTICE
Sphinx property that specifies whether to build a word lattice.

See Also:
Constant Field Values

PROP_BUILD_WORD_LATTICE_DEFAULT

public static final boolean PROP_BUILD_WORD_LATTICE_DEFAULT
The default value of the PROP_BUILD_WORD_LATTICE property.

See Also:
Constant Field Values

PROP_MAX_LATTICE_EDGES

public static final java.lang.String PROP_MAX_LATTICE_EDGES
Sphinx property that specifies the maximum lattice edges

See Also:
Constant Field Values

PROP_MAX_LATTICE_EDGES_DEFAULT

public static final int PROP_MAX_LATTICE_EDGES_DEFAULT
The default value of the PROP_MAX_LATTICE_EDGES property.

See Also:
Constant Field Values

PROP_ACOUSTIC_LOOKAHEAD_FRAMES

public static final java.lang.String PROP_ACOUSTIC_LOOKAHEAD_FRAMES
A sphinx property that controls the amount of simple acoustic lookahead performed. Setting the property to zero (the default) disables simple acoustic lookahead. The lookahead need not be an integer.

See Also:
Constant Field Values

PROP_ACOUSTIC_LOOKAHEAD_FRAMES_DEFAULT

public static final float PROP_ACOUSTIC_LOOKAHEAD_FRAMES_DEFAULT
The default value for the PROP_ACOUSTIC_LOOKAHEAD_FRAMES property.

See Also:
Constant Field Values

PROP_KEEP_ALL_TOKENS

public static final java.lang.String PROP_KEEP_ALL_TOKENS
A sphinx property that controls whether or not we keep all tokens. If this is set to false, only word tokens are retained, otherwise all tokens are retained.

See Also:
Constant Field Values

PROP_KEEP_ALL_TOKENS_DEFAULT

public static final boolean PROP_KEEP_ALL_TOKENS_DEFAULT
The default value for the PROP_ACOUSTIC_LOOKAHEAD_FRAMES property.

See Also:
Constant Field Values

PROP_RELATIVE_BEAM_WIDTH

public static final java.lang.String PROP_RELATIVE_BEAM_WIDTH
Sphinx4 property that specifies the relative beam width

See Also:
Constant Field Values

PROP_RELATIVE_BEAM_WIDTH_DEFAULT

public static final float PROP_RELATIVE_BEAM_WIDTH_DEFAULT
Sphinx4 property that specifies the default value for the relative beam width

See Also:
Constant Field Values
Constructor Detail

WordPruningBreadthFirstSearchManager

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

allocate

public void allocate()
              throws java.io.IOException
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
Throws:
java.io.IOException

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

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

stopRecognition

public void stopRecognition()
Terminates a recognition

Specified by:
stopRecognition in interface SearchManager

getLinguist

public Linguist getLinguist()
Returns the Linguist.

Returns:
the Linguist

getPruner

public Pruner getPruner()
Returns the Pruner.

Returns:
the Pruner

getAcousticScorer

public AcousticScorer getAcousticScorer()
Returns the AcousticScorer.

Returns:
the AcousticScorer

getLogMath

public LogMath getLogMath()
Returns the LogMath used.

Returns:
the LogMath used

getActiveList

public ActiveList getActiveList()
Returns the ActiveList.

Returns:
the ActiveList

setActiveList

public void setActiveList(ActiveList activeList)
Sets the ActiveList.

Parameters:
activeList - the new ActiveList

getResultList

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

Returns:
the result list

setResultList

public void setResultList(java.util.List resultList)
Sets the result list.

Parameters:
resultList - the new 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.