edu.cmu.sphinx.linguist.language.ngram
Class NetworkLanguageModel

java.lang.Object
  extended by edu.cmu.sphinx.linguist.language.ngram.NetworkLanguageModel
All Implemented Interfaces:
LanguageModel, Configurable

public class NetworkLanguageModel
extends java.lang.Object
implements LanguageModel


Field Summary
static java.lang.String PROP_HOST
          The property specifying the host of the language model server.
static java.lang.String PROP_LOG_MATH
          Sphinx property that defines the logMath component.
static java.lang.String PROP_PORT
          The property specifying the port of the language model server.
 
Fields inherited from interface edu.cmu.sphinx.linguist.language.ngram.LanguageModel
PROP_DICTIONARY, PROP_FORMAT, PROP_LOCATION, PROP_MAX_DEPTH, PROP_UNIGRAM_WEIGHT
 
Constructor Summary
NetworkLanguageModel()
           
 
Method Summary
 void allocate()
          Create the language model
 void deallocate()
          Deallocate resources allocated to this language model
 int getMaxDepth()
          Returns the maximum depth of the language model
 float getProbability(WordSequence wordSequence)
          Gets the n-gram 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<java.lang.String> getVocabulary()
          Returns the set of words in the language 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

PROP_LOG_MATH

@S4Component(type=LogMath.class)
public static final java.lang.String PROP_LOG_MATH
Sphinx property that defines the logMath component.

See Also:
Constant Field Values

PROP_HOST

@S4String(defaultValue="localhost")
public static final java.lang.String PROP_HOST
The property specifying the host of the language model server.

See Also:
Constant Field Values

PROP_PORT

@S4Integer(defaultValue=2525)
public static final java.lang.String PROP_PORT
The property specifying the port of the language model server.

See Also:
Constant Field Values
Constructor Detail

NetworkLanguageModel

public NetworkLanguageModel()
Method Detail

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
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

allocate

public void allocate()
              throws java.io.IOException
Description copied from interface: LanguageModel
Create the language model

Specified by:
allocate in interface LanguageModel
Throws:
java.io.IOException

deallocate

public void deallocate()
Description copied from interface: LanguageModel
Deallocate resources allocated to this language model

Specified by:
deallocate in interface LanguageModel

getMaxDepth

public int getMaxDepth()
Description copied from interface: LanguageModel
Returns the maximum depth of the language model

Specified by:
getMaxDepth in interface LanguageModel
Returns:
the maximum depth of the language model

getProbability

public float getProbability(WordSequence wordSequence)
Description copied from interface: LanguageModel
Gets the n-gram probability of the word sequence represented by the word list

Specified by:
getProbability in interface LanguageModel
Parameters:
wordSequence - the wordSequence
Returns:
the probability of the word sequence in LogMath log base

getSmear

public float getSmear(WordSequence wordSequence)
Description copied from interface: LanguageModel
Gets the smear term for the given wordSequence

Specified by:
getSmear in interface LanguageModel
Parameters:
wordSequence - the word sequence
Returns:
the smear term associated with this word sequence

getVocabulary

public java.util.Set<java.lang.String> getVocabulary()
Description copied from interface: LanguageModel
Returns the set of words in the language model. The set is unmodifiable.

Specified by:
getVocabulary in interface LanguageModel
Returns:
the unmodifiable set of words

start

public void start()
Description copied from interface: LanguageModel
Called before a recognition

Specified by:
start in interface LanguageModel

stop

public void stop()
Description copied from interface: LanguageModel
Called after a recognition

Specified by:
stop in interface LanguageModel