|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.linguist.dictionary.FastDictionary
Creates a dictionary by quickly reading in an ASCII-based Sphinx-3 format dictionary. It is called the FastDictionary because the loading is fast. When loaded the dictionary just loads each line of the dictionary into the hash table, assuming that most words are not going to be used. Only when a word is actually used is its pronunciations massaged into an array of pronunciations.
The format of the ASCII dictionary that it explains is the same as the
FullDictionary
, i.e., the word, followed by spaces
or tab, followed by the pronunciation(s). For example, a digits dictionary
will look like:
ONE HH W AH N ONE(2) W AH N TWO T UW THREE TH R IY FOUR F AO R FIVE F AY V SIX S IH K S SEVEN S EH V AH N EIGHT EY T NINE N AY N ZERO Z IH R OW ZERO(2) Z IY R OW OH OW
In the above example, the words "one" and "zero" have two pronunciations each.
Field Summary |
Constructor Summary | |
FastDictionary()
|
Method Summary | |
void |
allocate()
Allocates the dictionary |
void |
deallocate()
Deallocates the dictionary |
void |
dump()
Dumps this FastDictionary to System.out. |
Word[] |
getFillerWords()
Gets the set of all filler words in the dictionary |
java.lang.String |
getName()
Retrieves the name for this configurable component |
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. |
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. |
java.lang.String |
toString()
Returns a string representation of this FastDictionary in alphabetical order. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FastDictionary()
Method Detail |
public void register(java.lang.String name, Registry registry) throws PropertyException
Configurable
register
in interface Configurable
name
- the name of the componentregistry
- the registry for this component
PropertyException
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
ps
- a property sheet holding the new data
PropertyException
- if there is a problem with the properties.public java.lang.String getName()
Configurable
getName
in interface Configurable
public void allocate() throws java.io.IOException
Dictionary
allocate
in interface Dictionary
java.io.IOException
- if there is trouble loading the dictionarypublic void deallocate()
Dictionary
deallocate
in interface Dictionary
public Word getSentenceStartWord()
getSentenceStartWord
in interface Dictionary
public Word getSentenceEndWord()
getSentenceEndWord
in interface Dictionary
public Word getSilenceWord()
getSilenceWord
in interface Dictionary
public Word getWord(java.lang.String text)
getWord
in interface Dictionary
text
- the spelling of the word of interest.
Word
public WordClassification[] getPossibleWordClassifications()
getPossibleWordClassifications
in interface Dictionary
public java.lang.String toString()
public Word[] getFillerWords()
getFillerWords
in interface Dictionary
public void dump()
dump
in interface Dictionary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |