public class LMGrammar extends Grammar
grammar node
per word. This
grammar can deal with unigram and bigram grammars of up to 1000 or so words. Note that all probabilities are in the
log math domain.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_LANGUAGE_MODEL
The property for the language model to be used by this grammar
|
dictionary, initialNode, logger, PROP_ADD_FILLER_WORDS, PROP_ADD_SIL_WORDS, PROP_DICTIONARY, PROP_OPTIMIZE_GRAMMAR, PROP_SHOW_GRAMMAR
Constructor and Description |
---|
LMGrammar() |
LMGrammar(LanguageModel languageModel,
boolean showGrammar,
boolean optimizeGrammar,
boolean addSilenceWords,
boolean addFillerWords,
Dictionary dictionary) |
Modifier and Type | Method and Description |
---|---|
protected GrammarNode |
createGrammar()
Creates the grammar from the language model.
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
allocate, createGrammar, createGrammarNode, createGrammarNode, createGrammarNode, createGrammarNode, createGrammarNode, deallocate, dumpGrammar, dumpRandomSentences, dumpRandomSentences, dumpStatistics, getDictionary, getGrammarNodes, getInitialNode, getNumNodes, getRandomSentence, newGrammar, postProcessGrammar
@S4Component(type=LanguageModel.class) public static final java.lang.String PROP_LANGUAGE_MODEL
public LMGrammar(LanguageModel languageModel, boolean showGrammar, boolean optimizeGrammar, boolean addSilenceWords, boolean addFillerWords, Dictionary dictionary)
public LMGrammar()
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class Grammar
ps
- a property sheet holding the new dataPropertyException
- if there is a problem with the properties.protected GrammarNode createGrammar() throws java.io.IOException
createGrammar
in class Grammar
java.io.IOException
- if the grammar could not be loaded