edu.cmu.sphinx.decoder.search
Class SimpleActiveListManager

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

public class SimpleActiveListManager
extends java.lang.Object
implements ActiveListManager

A list of ActiveLists. Different token types are placed in different lists. This class is not thread safe and should only be used by a single thread.


Field Summary
static java.lang.String PROP_ACTIVE_LIST_FACTORIES
          Sphinx property that defines the name of the active list factory to be used by this search manager.
static java.lang.String PROP_CHECK_PRIOR_LISTS_EMPTY
          This property is used in the Iterator returned by the getNonEmittingListIterator() method.
static boolean PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT
          The default value of PROP_CHECK_PRIOR_LISTS_EMPTY.
 
Fields inherited from interface edu.cmu.sphinx.decoder.search.ActiveListManager
PROP_ABSOLUTE_WORD_BEAM_WIDTH, PROP_ABSOLUTE_WORD_BEAM_WIDTH_DEFAULT, PROP_RELATIVE_WORD_BEAM_WIDTH, PROP_RELATIVE_WORD_BEAM_WIDTH_DEFAULT
 
Constructor Summary
SimpleActiveListManager()
           
 
Method Summary
 void add(Token token)
          Adds the given token to the list
 void dump()
          Outputs debugging info for this list manager
 ActiveList getEmittingList()
          Returns the emitting ActiveList, and removes it from this manager.
 java.lang.String getName()
          Retrieves the name for this configurable component
 java.util.Iterator getNonEmittingListIterator()
          Returns an Iterator of all the non-emitting ActiveLists.
 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 replace(Token oldToken, Token newToken)
          Replaces an old token with a new token
 void setNumStateOrder(int numStateOrder)
          Sets the total number of state types to be managed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CHECK_PRIOR_LISTS_EMPTY

public static final java.lang.String PROP_CHECK_PRIOR_LISTS_EMPTY
This property is used in the Iterator returned by the getNonEmittingListIterator() method. When the Iterator.next() method is called, this property determines whether the lists prior to that returned by next() are empty (they should be empty). If they are not empty, an Error will be thrown.

See Also:
Constant Field Values

PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT

public static final boolean PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT
The default value of PROP_CHECK_PRIOR_LISTS_EMPTY.

See Also:
Constant Field Values

PROP_ACTIVE_LIST_FACTORIES

public static final java.lang.String PROP_ACTIVE_LIST_FACTORIES
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

SimpleActiveListManager

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

setNumStateOrder

public void setNumStateOrder(int numStateOrder)
Description copied from interface: ActiveListManager
Sets the total number of state types to be managed

Specified by:
setNumStateOrder in interface ActiveListManager
Parameters:
numStateOrder - the total number of state types

add

public void add(Token token)
Adds the given token to the list

Specified by:
add in interface ActiveListManager
Parameters:
token - the token to add

replace

public void replace(Token oldToken,
                    Token newToken)
Replaces an old token with a new token

Specified by:
replace in interface ActiveListManager
Parameters:
oldToken - the token to replace (or null in which case, replace works like add).
newToken - the new token to be placed in the list.

getEmittingList

public ActiveList getEmittingList()
Returns the emitting ActiveList, and removes it from this manager.

Specified by:
getEmittingList in interface ActiveListManager
Returns:
the emitting ActiveList

getNonEmittingListIterator

public java.util.Iterator getNonEmittingListIterator()
Returns an Iterator of all the non-emitting ActiveLists. The iteration order is the same as the search state order.

Specified by:
getNonEmittingListIterator in interface ActiveListManager
Returns:
an Iterator of non-emitting ActiveLists

dump

public void dump()
Outputs debugging info for this list manager

Specified by:
dump in interface ActiveListManager