edu.cmu.sphinx.linguist.dictionary
Interface Dictionary

All Superinterfaces:
Configurable
All Known Implementing Classes:
FastDictionary, FullDictionary

public interface Dictionary
extends Configurable

Provides a generic interface to a dictionary. The dictionary is responsibile for determining how a word is pronounced.


Field Summary
static java.lang.String PROP_ADD_SIL_ENDING_PRONUNCIATION
          The name of the SphinxProperty that specifies whether to add a duplicate SIL-ending pronunication.
static boolean PROP_ADD_SIL_ENDING_PRONUNCIATION_DEFAULT
          The default value of PROP_ADD_SIL_ENDING_PRONUNCIATION.
static java.lang.String PROP_ALLOW_MISSING_WORDS
          The name of the SphinxProperty that specifies whether the dictionary should return null if a word is not found in the dictionary, or whether it should throw an error.
static boolean PROP_ALLOW_MISSING_WORDS_DEFAULT
          The default value of PROP_ALLOW_MISSING_WORDS.
static java.lang.String PROP_CREATE_MISSING_WORDS
          The SphinxProperty that specifies whether the Dictionary.getWord() method should return a Word object even if the word does not exist in the dictionary.
static boolean PROP_CREATE_MISSING_WORDS_DEFAULT
          The default value of PROP_CREATE_MISSING_WORD.
static java.lang.String PROP_DICTIONARY
          The name of the SphinxProperty for the dictionary file path.
static java.lang.String PROP_DICTIONARY_DEFAULT
          The default value of PROP_DICTIONARY.
static java.lang.String PROP_FILLER_DICTIONARY
          The name of the SphinxProperty for the filler dictionary file path.
static java.lang.String PROP_FILLER_DICTIONARY_DEFAULT
          The default value of PROP_FILLER_DICTIONARY.
static java.lang.String PROP_LOCATION
          The name of the SphinxProperty that defines the location (directory or jar file) for the dictionary
static java.lang.String PROP_LOCATION_DEFAULT
          The default value of PROP_LOCATION.
static java.lang.String PROP_UNIT_MANAGER
          The sphinx property that defines the name of the unit manager that is used to convert strings to Unit objects
static java.lang.String PROP_WORD_REPLACEMENT
          The name of the SphinxProperty that specifies the word to substitute when a lookup fails to find the word in the dictionary.
static java.lang.String PROP_WORD_REPLACEMENT_DEFAULT
          The default value of PROP_WORD_REPLACEMENT.
static java.lang.String SENTENCE_END_SPELLING
          Spelling of the sentence end word.
static java.lang.String SENTENCE_START_SPELLING
          Spelling of the sentence start word.
static java.lang.String SILENCE_SPELLING
          Spelling of the 'word' that marks a silence
 
Method Summary
 void allocate()
          Allocates the dictionary
 void deallocate()
          Deallocates the dictionary
 void dump()
          Dumps out a 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)
          Returns a Word object based on the spelling and its classification.
 
Methods inherited from interface edu.cmu.sphinx.util.props.Configurable
getName, newProperties, register
 

Field Detail

SENTENCE_START_SPELLING

public static final java.lang.String SENTENCE_START_SPELLING
Spelling of the sentence start word.

See Also:
Constant Field Values

SENTENCE_END_SPELLING

public static final java.lang.String SENTENCE_END_SPELLING
Spelling of the sentence end word.

See Also:
Constant Field Values

SILENCE_SPELLING

public static final java.lang.String SILENCE_SPELLING
Spelling of the 'word' that marks a silence

See Also:
Constant Field Values

PROP_LOCATION

public static final java.lang.String PROP_LOCATION
The name of the SphinxProperty that defines the location (directory or jar file) for the dictionary

See Also:
Constant Field Values

PROP_LOCATION_DEFAULT

public static final java.lang.String PROP_LOCATION_DEFAULT
The default value of PROP_LOCATION.


PROP_DICTIONARY

public static final java.lang.String PROP_DICTIONARY
The name of the SphinxProperty for the dictionary file path.

See Also:
Constant Field Values

PROP_DICTIONARY_DEFAULT

public static final java.lang.String PROP_DICTIONARY_DEFAULT
The default value of PROP_DICTIONARY.


PROP_FILLER_DICTIONARY

public static final java.lang.String PROP_FILLER_DICTIONARY
The name of the SphinxProperty for the filler dictionary file path.

See Also:
Constant Field Values

PROP_FILLER_DICTIONARY_DEFAULT

public static final java.lang.String PROP_FILLER_DICTIONARY_DEFAULT
The default value of PROP_FILLER_DICTIONARY.


PROP_ADD_SIL_ENDING_PRONUNCIATION

public static final java.lang.String PROP_ADD_SIL_ENDING_PRONUNCIATION
The name of the SphinxProperty that specifies whether to add a duplicate SIL-ending pronunication.

See Also:
Constant Field Values

PROP_ADD_SIL_ENDING_PRONUNCIATION_DEFAULT

public static final boolean PROP_ADD_SIL_ENDING_PRONUNCIATION_DEFAULT
The default value of PROP_ADD_SIL_ENDING_PRONUNCIATION.

See Also:
Constant Field Values

PROP_WORD_REPLACEMENT

public static final java.lang.String PROP_WORD_REPLACEMENT
The name of the SphinxProperty that specifies the word to substitute when a lookup fails to find the word in the dictionary. If this is not set, no substitute is performed.

See Also:
Constant Field Values

PROP_WORD_REPLACEMENT_DEFAULT

public static final java.lang.String PROP_WORD_REPLACEMENT_DEFAULT
The default value of PROP_WORD_REPLACEMENT.


PROP_ALLOW_MISSING_WORDS

public static final java.lang.String PROP_ALLOW_MISSING_WORDS
The name of the SphinxProperty that specifies whether the dictionary should return null if a word is not found in the dictionary, or whether it should throw an error. If true, a null is returned for words that are not found in the dictionary (and the 'PROP_WORD_REPLACEMENT' property is not set).

See Also:
Constant Field Values

PROP_ALLOW_MISSING_WORDS_DEFAULT

public static final boolean PROP_ALLOW_MISSING_WORDS_DEFAULT
The default value of PROP_ALLOW_MISSING_WORDS.

See Also:
Constant Field Values

PROP_CREATE_MISSING_WORDS

public static final java.lang.String PROP_CREATE_MISSING_WORDS
The SphinxProperty that specifies whether the Dictionary.getWord() method should return a Word object even if the word does not exist in the dictionary. If this property is true, and property allowMissingWords is also true, the method will return a Word, but the Word will have null Pronunciations. Otherwise, the method will return null. This property is usually only used for testing purposes.

See Also:
Constant Field Values

PROP_CREATE_MISSING_WORDS_DEFAULT

public static final boolean PROP_CREATE_MISSING_WORDS_DEFAULT
The default value of PROP_CREATE_MISSING_WORD.

See Also:
Constant Field Values

PROP_UNIT_MANAGER

public static final java.lang.String PROP_UNIT_MANAGER
The sphinx property that defines the name of the unit manager that is used to convert strings to Unit objects

See Also:
Constant Field Values
Method Detail

getWord

public Word getWord(java.lang.String text)
Returns a Word object based on the spelling and its classification. The behavior of this method is also affected by the properties wordReplacement, allowMissingWords, and createMissingWords.

Parameters:
text - the spelling of the word of interest.
Returns:
a Word object
See Also:
Pronunciation

getSentenceStartWord

public Word getSentenceStartWord()
Returns the sentence start word.

Returns:
the sentence start word

getSentenceEndWord

public Word getSentenceEndWord()
Returns the sentence end word.

Returns:
the sentence end word

getSilenceWord

public Word getSilenceWord()
Returns the silence word.

Returns:
the silence word

getPossibleWordClassifications

public WordClassification[] getPossibleWordClassifications()
Returns the set of all possible word classifications for this dictionary.

Returns:
the set of all possible word classifications

dump

public void dump()
Dumps out a dictionary


getFillerWords

public Word[] getFillerWords()
Gets the set of all filler words in the dictionary

Returns:
an array (possibly empty) of all filler words

allocate

public void allocate()
              throws java.io.IOException
Allocates the dictionary

Throws:
java.io.IOException - if there is trouble loading the dictionary

deallocate

public void deallocate()
Deallocates the dictionary