edu.cmu.sphinx.linguist.language.grammar
Class LMGrammar

java.lang.Object
  extended byedu.cmu.sphinx.linguist.language.grammar.Grammar
      extended byedu.cmu.sphinx.linguist.language.grammar.LMGrammar
All Implemented Interfaces:
Configurable

public class LMGrammar
extends Grammar

Defines a simple grammar based upon a language model. It generates one grammar nodeper 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.


Field Summary
static java.lang.String PROP_LANGUAGE_MODEL
          A sphinx property for the language model to be used by this grammar
 
Fields inherited from class edu.cmu.sphinx.linguist.language.grammar.Grammar
PROP_ADD_FILLER_WORDS, PROP_ADD_FILLER_WORDS_DEFAULT, PROP_ADD_SIL_WORDS, PROP_ADD_SIL_WORDS_DEFAULT, PROP_DICTIONARY, PROP_OPTIMIZE_GRAMMAR, PROP_OPTIMIZE_GRAMMAR_DEFAULT, PROP_SHOW_GRAMMAR, PROP_SHOW_GRAMMAR_DEFAULT
 
Constructor Summary
LMGrammar()
           
 
Method Summary
 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.
 
Methods inherited from class edu.cmu.sphinx.linguist.language.grammar.Grammar
allocate, deallocate, dumpGrammar, dumpRandomSentences, dumpRandomSentences, dumpStatistics, getGrammarNodes, getInitialNode, getName, getNumNodes, getRandomSentence
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_LANGUAGE_MODEL

public static final java.lang.String PROP_LANGUAGE_MODEL
A sphinx property for the language model to be used by this grammar

See Also:
Constant Field Values
Constructor Detail

LMGrammar

public LMGrammar()
Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class Grammar
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class Grammar
Throws:
PropertyException