edu.cmu.sphinx.linguist.language.grammar
Class SimpleWordListGrammar
java.lang.Object
edu.cmu.sphinx.linguist.language.grammar.Grammar
edu.cmu.sphinx.linguist.language.grammar.SimpleWordListGrammar
- All Implemented Interfaces:
- GrammarInterface, Configurable
public class SimpleWordListGrammar
- extends Grammar
- implements Configurable
Defines a grammar based upon a list of words in a file. The format of the file is just one word per line. For
example, for an isolated digits grammar the file will simply look like:
zero
one
two
three
four
five
six
seven
eight
nine
The 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.
|
Field Summary |
static java.lang.String |
PROP_LOG_MATH
The property that defines the logMath component. |
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 |
|
Method Summary |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured. |
| Methods inherited from class edu.cmu.sphinx.linguist.language.grammar.Grammar |
allocate, deallocate, dumpGrammar, dumpRandomSentences, dumpRandomSentences, dumpStatistics, getDictionary, getGrammarNodes, getInitialNode, getNumNodes, getRandomSentence |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_PATH
@S4String(defaultValue="spelling.gram")
public static final java.lang.String PROP_PATH
- The property that defines the location of the word list grammar
- See Also:
- Constant Field Values
PROP_LOOP
@S4Boolean(defaultValue=true)
public static final java.lang.String PROP_LOOP
- The property that if true, indicates that this is a looping grammar
- See Also:
- Constant Field Values
PROP_LOG_MATH
@S4Component(type=LogMath.class)
public static final java.lang.String PROP_LOG_MATH
- The property that defines the logMath component.
- See Also:
- Constant Field Values
SimpleWordListGrammar
public SimpleWordListGrammar(java.lang.String path,
boolean isLooping,
LogMath logMath,
boolean showGrammar,
boolean optimizeGrammar,
boolean addSilenceWords,
boolean addFillerWords,
Dictionary dictionary)
SimpleWordListGrammar
public SimpleWordListGrammar()
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- Overrides:
newProperties in class Grammar
- Parameters:
ps - a property sheet holding the new data
- Throws:
PropertyException - if there is a problem with the properties.