edu.cmu.sphinx.linguist.language.classes
Class ClassPresentingDictionary

java.lang.Object
  extended by edu.cmu.sphinx.linguist.language.classes.ClassPresentingDictionary
All Implemented Interfaces:
Dictionary, Configurable

public class ClassPresentingDictionary
extends java.lang.Object
implements Dictionary

The only purpose of this class is to present all classes as words in the getWord() method. This dictionary must be injected to a class LM as a dictionary, otherwise classes will be treated as OOVs.

Author:
Tanel Alumae

Field Summary
static java.lang.String PROP_CLASS_MAP
           
static java.lang.String PROP_WORD_DICTIONARY
           
 
Fields inherited from interface edu.cmu.sphinx.linguist.dictionary.Dictionary
PROP_ADD_SIL_ENDING_PRONUNCIATION, PROP_ALLOW_MISSING_WORDS, PROP_CREATE_MISSING_WORDS, PROP_DICTIONARY, PROP_FILLER_DICTIONARY, PROP_UNIT_MANAGER, PROP_WORD_REPLACEMENT, SENTENCE_END_SPELLING, SENTENCE_START_SPELLING, SILENCE_SPELLING
 
Constructor Summary
ClassPresentingDictionary()
           
ClassPresentingDictionary(ClassMap classMap, Dictionary wordDictionary)
           
 
Method Summary
 void allocate()
          Allocates the dictionary
 void deallocate()
          Deallocates the dictionary
 Word[] getFillerWords()
          Gets the set of all filler words in the dictionary
 WordClassification[] getPossibleWordClassifications()
          Returns the set of all possible word classifications for this dictionary.
 Word getSentenceEndWord()
          Returns the sentence end word.
 Word getSentenceStartWord()
          Returns the sentence start word.
 Word getSilenceWord()
          Returns the silence word.
 Word getWord(java.lang.String text)
          This method disguises all classes as words.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_CLASS_MAP

@S4Component(type=ClassMap.class)
public static final java.lang.String PROP_CLASS_MAP
See Also:
Constant Field Values

PROP_WORD_DICTIONARY

@S4Component(type=Dictionary.class)
public static final java.lang.String PROP_WORD_DICTIONARY
See Also:
Constant Field Values
Constructor Detail

ClassPresentingDictionary

public ClassPresentingDictionary(ClassMap classMap,
                                 Dictionary wordDictionary)

ClassPresentingDictionary

public ClassPresentingDictionary()
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: Dictionary
Allocates the dictionary

Specified by:
allocate in interface Dictionary
Throws:
java.io.IOException - if there is trouble loading the dictionary

deallocate

public void deallocate()
Description copied from interface: Dictionary
Deallocates the dictionary

Specified by:
deallocate in interface Dictionary

getWord

public Word getWord(java.lang.String text)
This method disguises all classes as words.

Specified by:
getWord in interface Dictionary
Parameters:
text - the spelling of the word of interest.
Returns:
a Word object
See Also:
Pronunciation

getSentenceStartWord

public Word getSentenceStartWord()
Description copied from interface: Dictionary
Returns the sentence start word.

Specified by:
getSentenceStartWord in interface Dictionary
Returns:
the sentence start word

getSentenceEndWord

public Word getSentenceEndWord()
Description copied from interface: Dictionary
Returns the sentence end word.

Specified by:
getSentenceEndWord in interface Dictionary
Returns:
the sentence end word

getSilenceWord

public Word getSilenceWord()
Description copied from interface: Dictionary
Returns the silence word.

Specified by:
getSilenceWord in interface Dictionary
Returns:
the silence word

getPossibleWordClassifications

public WordClassification[] getPossibleWordClassifications()
Description copied from interface: Dictionary
Returns the set of all possible word classifications for this dictionary.

Specified by:
getPossibleWordClassifications in interface Dictionary
Returns:
the set of all possible word classifications

getFillerWords

public Word[] getFillerWords()
Description copied from interface: Dictionary
Gets the set of all filler words in the dictionary

Specified by:
getFillerWords in interface Dictionary
Returns:
an array (possibly empty) of all filler words

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object