public class SimpleWordListGrammar extends Grammar implements Configurable
zero one two three four five six seven eight nineThe path to the file is defined by the
PROP_PATH
property. If the PROP_LOOP
property is true, the grammar created will be a looping grammar. Using the above digits grammar example, setting
PROP_LOOP to true will make it a connected-digits grammar.
All probabilities are maintained in LogMath log base.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_LOOP
The property that if true, indicates that this is a looping grammar
|
static java.lang.String |
PROP_PATH
The property that defines the location of the word list grammar
|
dictionary, initialNode, logger, PROP_ADD_FILLER_WORDS, PROP_ADD_SIL_WORDS, PROP_DICTIONARY, PROP_OPTIMIZE_GRAMMAR, PROP_SHOW_GRAMMAR
Constructor and Description |
---|
SimpleWordListGrammar() |
SimpleWordListGrammar(java.lang.String path,
boolean isLooping,
boolean showGrammar,
boolean optimizeGrammar,
boolean addSilenceWords,
boolean addFillerWords,
Dictionary dictionary) |
Modifier and Type | Method and Description |
---|---|
protected GrammarNode |
createGrammar()
Creates the grammar.
|
protected GrammarNode |
createGrammar(java.lang.String bogusText)
Create class from reference text (not implemented).
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
allocate, createGrammarNode, createGrammarNode, createGrammarNode, createGrammarNode, createGrammarNode, deallocate, dumpGrammar, dumpRandomSentences, dumpRandomSentences, dumpStatistics, getDictionary, getGrammarNodes, getInitialNode, getNumNodes, getRandomSentence, newGrammar, postProcessGrammar
@S4String(defaultValue="spelling.gram") public static final java.lang.String PROP_PATH
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_LOOP
public SimpleWordListGrammar(java.lang.String path, boolean isLooping, boolean showGrammar, boolean optimizeGrammar, boolean addSilenceWords, boolean addFillerWords, Dictionary dictionary)
public SimpleWordListGrammar()
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(java.lang.String bogusText) throws java.lang.NoSuchMethodException
createGrammar
in class Grammar
bogusText
- dummy variablejava.lang.NoSuchMethodException
- if called with reference sentenceprotected GrammarNode createGrammar() throws java.io.IOException
createGrammar
in class Grammar
java.io.IOException
- if the grammar could not be loaded