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 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 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 java.lang.String PROP_DICTIONARY
          The name of the SphinxProperty for the dictionary file path.
static java.lang.String PROP_FILLER_DICTIONARY
          The name of the SphinxProperty for the filler dictionary file path.
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 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
 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
newProperties
 

Field Detail

SENTENCE_START_SPELLING

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

See Also:
Constant Field Values

SENTENCE_END_SPELLING

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

See Also:
Constant Field Values

SILENCE_SPELLING

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

See Also:
Constant Field Values

PROP_DICTIONARY

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

See Also:
Constant Field Values

PROP_FILLER_DICTIONARY

@S4String
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_ADD_SIL_ENDING_PRONUNCIATION

@S4Boolean(defaultValue=false)
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_WORD_REPLACEMENT

@S4String(mandatory=false)
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_ALLOW_MISSING_WORDS

@S4Boolean(defaultValue=false)
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_CREATE_MISSING_WORDS

@S4Boolean(defaultValue=false)
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_UNIT_MANAGER

@S4Component(type=UnitManager.class,
             defaultClass=UnitManager.class)
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

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

Word getSentenceStartWord()
Returns the sentence start word.

Returns:
the sentence start word

getSentenceEndWord

Word getSentenceEndWord()
Returns the sentence end word.

Returns:
the sentence end word

getSilenceWord

Word getSilenceWord()
Returns the silence word.

Returns:
the silence word

getPossibleWordClassifications

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

Returns:
the set of all possible word classifications

getFillerWords

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

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

allocate

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

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

deallocate

void deallocate()
Deallocates the dictionary