|
|||||||||
| 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
public class 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 |
java.util.logging.Logger |
getLogger()
Used for reporting errors and warnings during loading |
int |
getMaxDepth()
Returns the maximum depth of the language model |
java.lang.String |
getName()
|
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 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 |
|---|
@S4Component(type=LogMath.class) public static final java.lang.String PROP_LOG_MATH
| Constructor Detail |
|---|
public SimpleNGramModel()
| Method Detail |
|---|
public java.util.logging.Logger getLogger()
LanguageModel
getLogger in interface LanguageModel
public void newProperties(PropertySheet ps)
throws PropertyException
Configurable
newProperties in interface Configurableps - 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 LanguageModeljava.io.IOExceptionpublic void deallocate()
LanguageModel
deallocate in interface LanguageModelpublic java.lang.String getName()
public void start()
start in interface LanguageModelpublic void stop()
stop in interface LanguageModelpublic float getProbability(WordSequence wordSequence)
getProbability in interface LanguageModelwordSequence - the word sequence
public float getSmear(WordSequence wordSequence)
getSmear in interface LanguageModelwordSequence - the word sequence
public float getBackoff(WordSequence wordSequence)
wordSequence - the sequence of words
public int getMaxDepth()
getMaxDepth in interface LanguageModelpublic java.util.Set getVocabulary()
getVocabulary in interface LanguageModelpublic void dump()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||