edu.cmu.sphinx.linguist.language.ngram
Class KeywordOptimizerModel

java.lang.Object
  extended by edu.cmu.sphinx.linguist.language.ngram.KeywordOptimizerModel
All Implemented Interfaces:
LanguageModel, Configurable

public class KeywordOptimizerModel
extends java.lang.Object
implements LanguageModel


Field Summary
 java.util.HashMap<java.lang.String,java.lang.Float> keywordProbs
           
static java.lang.String PROP_PARENT
          Sphinx property that defines the parent language model.
 
Fields inherited from interface edu.cmu.sphinx.linguist.language.ngram.LanguageModel
PROP_DICTIONARY, PROP_FORMAT, PROP_LOCATION, PROP_MAX_DEPTH, PROP_UNIGRAM_WEIGHT
 
Constructor Summary
KeywordOptimizerModel()
           
KeywordOptimizerModel(LanguageModel parent)
           
 
Method Summary
 void allocate()
          Create the language model
 void deallocate()
          Deallocate resources allocated to this language model
 int getMaxDepth()
          Returns the maximum depth of the language model
 float getProbability(WordSequence wordSequence)
          Gets the ngram probability of the word sequence represented by the word list
 float getSmear(WordSequence wordSequence)
          Gets the smear term for the given wordSequence
 java.util.Set<java.lang.String> getVocabulary()
          Returns the set of words in the language model.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 void start()
          Called before a recognition
 void stop()
          Called after a recognition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_PARENT

@S4Component(type=LanguageModel.class)
public static final java.lang.String PROP_PARENT
Sphinx property that defines the parent language model.

See Also:
Constant Field Values

keywordProbs

public java.util.HashMap<java.lang.String,java.lang.Float> keywordProbs
Constructor Detail

KeywordOptimizerModel

public KeywordOptimizerModel(LanguageModel parent)

KeywordOptimizerModel

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

allocate

public void allocate()
              throws java.io.IOException
Description copied from interface: LanguageModel
Create the language model

Specified by:
allocate in interface LanguageModel
Throws:
java.io.IOException

deallocate

public void deallocate()
Description copied from interface: LanguageModel
Deallocate resources allocated to this language model

Specified by:
deallocate in interface LanguageModel

start

public void start()
Called before a recognition

Specified by:
start in interface LanguageModel

stop

public void stop()
Called after a recognition

Specified by:
stop in interface LanguageModel

getProbability

public float getProbability(WordSequence wordSequence)
Gets the ngram probability of the word sequence represented by the word list

Specified by:
getProbability in interface LanguageModel
Parameters:
wordSequence - the word sequence
Returns:
the probability of the word sequence. Probability is in logMath log base

getSmear

public float getSmear(WordSequence wordSequence)
Gets the smear term for the given wordSequence

Specified by:
getSmear in interface LanguageModel
Parameters:
wordSequence - the word sequence
Returns:
the smear term associated with this word sequence

getMaxDepth

public int getMaxDepth()
Returns the maximum depth of the language model

Specified by:
getMaxDepth in interface LanguageModel
Returns:
the maximum depth of the language model

getVocabulary

public java.util.Set<java.lang.String> getVocabulary()
Returns the set of words in the language model. The set is unmodifiable.

Specified by:
getVocabulary in interface LanguageModel
Returns:
the unmodifiable set of words