|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.linguist.language.ngram.SimpleNGramModel
An ascii ARPA language model loader. This loader makes no attempt to optimize storage, so it can only load very small language models
Note that all probabilites in the grammar are stored in LogMath log base format. Language Probabilties in the language model file are stored in log 10 base.
Field Summary | |
static java.lang.String |
PROP_LOG_MATH
Sphinx property that defines the logMath component. |
Fields inherited from interface edu.cmu.sphinx.linguist.language.ngram.LanguageModel |
PROP_DICTIONARY, PROP_FORMAT, PROP_FORMAT_DEFAULT, PROP_LOCATION, PROP_LOCATION_DEFAULT, PROP_MAX_DEPTH, PROP_MAX_DEPTH_DEFAULT, PROP_UNIGRAM_WEIGHT, PROP_UNIGRAM_WEIGHT_DEFAULT |
Constructor Summary | |
SimpleNGramModel()
|
Method Summary | |
void |
allocate()
Create the language model |
void |
deallocate()
Deallocate resources allocated to this language model |
void |
dump()
Dumps the language model |
float |
getBackoff(WordSequence wordSequence)
Returns the backoff probability for the give sequence of words |
int |
getMaxDepth()
Returns the maximum depth of the language model |
java.lang.String |
getName()
Retrieves the name for this configurable component |
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 |
getVocabulary()
Returns the set of words in the lanaguage model. |
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 |
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 |
public static final java.lang.String PROP_LOG_MATH
Constructor Detail |
public SimpleNGramModel()
Method Detail |
public void register(java.lang.String name, Registry registry) throws PropertyException
Configurable
register
in interface Configurable
name
- the name of the componentregistry
- the registry for this component
PropertyException
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
ps
- a property sheet holding the new data
PropertyException
- if there is a problem with the properties.public void allocate() throws java.io.IOException
LanguageModel
allocate
in interface LanguageModel
java.io.IOException
public void deallocate()
LanguageModel
deallocate
in interface LanguageModel
public java.lang.String getName()
Configurable
getName
in interface Configurable
public void start()
start
in interface LanguageModel
public void stop()
stop
in interface LanguageModel
public float getProbability(WordSequence wordSequence)
getProbability
in interface LanguageModel
wordSequence
- the word sequence
public float getSmear(WordSequence wordSequence)
getSmear
in interface LanguageModel
wordSequence
- the word sequence
public float getBackoff(WordSequence wordSequence)
wordSequence
- the sequence of words
public int getMaxDepth()
getMaxDepth
in interface LanguageModel
public java.util.Set getVocabulary()
getVocabulary
in interface LanguageModel
public void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |