edu.cmu.sphinx.decoder.scorer
Class AbstractScorer

java.lang.Object
  extended by edu.cmu.sphinx.util.props.ConfigurableAdapter
      extended by edu.cmu.sphinx.decoder.scorer.AbstractScorer
All Implemented Interfaces:
AcousticScorer, Configurable
Direct Known Subclasses:
SimpleAcousticScorer, ThreadedAcousticScorer

public abstract class AbstractScorer
extends ConfigurableAdapter
implements AcousticScorer

Implements some basic scorer functionality but keeps specific scoring open for sub-classes.

Author:
Holger Brandl

Field Summary
static java.lang.String FEATURE_FRONTEND
          Property the defines the frontend to retrieve features from for scoring
static java.lang.String SCORE_NORMALIZER
          An opotional post-processor for computed scores that will normalize scores.
 
Constructor Summary
AbstractScorer()
           
AbstractScorer(BaseDataProcessor frontEnd, ScoreNormalizer scoreNormalizer)
           
 
Method Summary
 void allocate()
          Allocates resources for this scorer
 Data calculateScores(java.util.List<? extends Scoreable> scoreableList)
          Scores the given set of states.
 void deallocate()
          Deallocates resources for this scorer
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 void startRecognition()
          starts the scorer
 void stopRecognition()
          stops the scorer
 
Methods inherited from class edu.cmu.sphinx.util.props.ConfigurableAdapter
getName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FEATURE_FRONTEND

@S4Component(type=BaseDataProcessor.class)
public static final java.lang.String FEATURE_FRONTEND
Property the defines the frontend to retrieve features from for scoring

See Also:
Constant Field Values

SCORE_NORMALIZER

@S4Component(type=ScoreNormalizer.class,
             mandatory=false)
public static final java.lang.String SCORE_NORMALIZER
An opotional post-processor for computed scores that will normalize scores. If not set, no normalization will applied and the token scores will be returned unchanged.

See Also:
Constant Field Values
Constructor Detail

AbstractScorer

public AbstractScorer()

AbstractScorer

public AbstractScorer(BaseDataProcessor frontEnd,
                      ScoreNormalizer scoreNormalizer)
Parameters:
frontEnd - the frontend to retrieve features from for scoring
scoreNormalizer - optional post-processor for computed scores that will normalize scores. If not set, no normalization will applied and the token scores will be returned unchanged.
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
Overrides:
newProperties in class ConfigurableAdapter
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

calculateScores

public Data calculateScores(java.util.List<? extends Scoreable> scoreableList)
Scores the given set of states.

Specified by:
calculateScores in interface AcousticScorer
Parameters:
scoreableList - A list containing scoreable objects to be scored
Returns:
The best scoring scoreable, or null if there are no more features to score

startRecognition

public void startRecognition()
Description copied from interface: AcousticScorer
starts the scorer

Specified by:
startRecognition in interface AcousticScorer

stopRecognition

public void stopRecognition()
Description copied from interface: AcousticScorer
stops the scorer

Specified by:
stopRecognition in interface AcousticScorer

allocate

public void allocate()
Description copied from interface: AcousticScorer
Allocates resources for this scorer

Specified by:
allocate in interface AcousticScorer

deallocate

public void deallocate()
Description copied from interface: AcousticScorer
Deallocates resources for this scorer

Specified by:
deallocate in interface AcousticScorer