|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrita.support.RiCMULexicon
public class RiCMULexicon
Provides an implementation of a user-customizable Lexicon using CMU-style pronunciation tags and penn-style part-of-speech tags.
The implementation also allows users to define their own addenda that will be used in addition to the system addenda. If the user defines their own addenda, it values will be added to the system addenda, overriding any existing elements in the system addenda.
| Method Summary | |
|---|---|
void |
addAddendum(java.lang.String word,
java.lang.String[] phones)
Adds a word to the addenda. |
void |
addAddendum(java.lang.String word,
java.lang.String pos,
java.lang.String[] phones)
|
int |
getAddendaCount()
Returns the number of user addenda items added to the lexicon |
static RiCMULexicon |
getInstance()
|
static RiCMULexicon |
getInstance(processing.core.PApplet p)
Creates, loads and returns the singleton lexicon instance. |
static RiCMULexicon |
getInstance(processing.core.PApplet p,
java.lang.String basename)
Creates, loads and returns the singleton lexicon instance. |
java.lang.String[] |
getPhones(java.lang.String word)
|
java.lang.String[] |
getPhones(java.lang.String word,
java.lang.String partOfSpeech)
Gets the phone list for a given word. |
java.lang.String[] |
getPhones(java.lang.String word,
java.lang.String partOfSpeech,
boolean useLTS)
Gets the phone list for a given word. |
java.lang.String[] |
getPosArr(java.lang.String word)
|
java.lang.String[] |
getRawStresses(java.lang.String word)
returns a '-' (denoting no mark) or 0 (unstressed) or 1 (stressed) for each phoneme |
java.util.Set |
getWords()
|
java.util.Set |
getWords(java.lang.String regex)
|
boolean |
isLoaded()
Determines if this lexicon is loaded. |
boolean |
isSyllableBoundary(java.util.List syllablePhones,
java.lang.String[] wordPhones,
int currentWordPhone)
Determines if the currentPhone represents a new syllable boundary. |
java.util.Iterator |
iterator()
|
java.util.Iterator |
iterator(boolean randomStartOffset)
|
java.util.Set |
keySet()
|
void |
load()
Loads the data into this lexicon. |
java.lang.String |
lookupPhonemesAndStresses(java.lang.String word)
|
java.lang.String |
lookupRaw(java.lang.String word)
|
static void |
main(java.lang.String[] args)
|
void |
removeAddendum(java.lang.String word,
java.lang.String partOfSpeech)
Removes a word from the lexicon. |
int |
size()
|
static void |
writeLexicon2(RiCMULexicon lex)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static RiCMULexicon getInstance()
public static RiCMULexicon getInstance(processing.core.PApplet p)
public static RiCMULexicon getInstance(processing.core.PApplet p,
java.lang.String basename)
public int getAddendaCount()
public boolean isLoaded()
isLoaded in interface com.sun.speech.freetts.lexicon.Lexicontrue if the lexicon is loaded
public void load()
throws java.io.IOException
load in interface com.sun.speech.freetts.lexicon.Lexiconjava.io.IOException - if errors occur during loading
public java.lang.String[] getPhones(java.lang.String word,
java.lang.String partOfSpeech)
null. The format is lexicon dependent. If the part
of speech does not matter, pass in null.
getPhones in interface com.sun.speech.freetts.lexicon.Lexicon
public java.lang.String[] getPhones(java.lang.String word,
java.lang.String partOfSpeech,
boolean useLTS)
null is returned. The partOfSpeech is
implementation dependent, but null always matches.
getPhones in interface com.sun.speech.freetts.lexicon.Lexicon
public void addAddendum(java.lang.String word,
java.lang.String[] phones)
public void removeAddendum(java.lang.String word,
java.lang.String partOfSpeech)
removeAddendum in interface com.sun.speech.freetts.lexicon.Lexiconword - the word to removepartOfSpeech - the part of speechpublic int size()
public boolean isSyllableBoundary(java.util.List syllablePhones,
java.lang.String[] wordPhones,
int currentWordPhone)
isSyllableBoundary in interface com.sun.speech.freetts.lexicon.LexiconsyllablePhones - the phones in the current syllable so farwordPhones - the phones for the whole wordcurrentWordPhone - the word phone in question
true if the word phone in question is on a
syllable boundary; otherwise false.public java.util.Set getWords()
public java.lang.String lookupRaw(java.lang.String word)
public java.lang.String lookupPhonemesAndStresses(java.lang.String word)
public java.util.Iterator iterator()
public java.util.Set keySet()
public java.util.Iterator iterator(boolean randomStartOffset)
public java.util.Set getWords(java.lang.String regex)
public java.lang.String[] getPosArr(java.lang.String word)
getPosArr in interface RiLexiconIFpublic java.lang.String[] getPhones(java.lang.String word)
public java.lang.String[] getRawStresses(java.lang.String word)
public void addAddendum(java.lang.String word,
java.lang.String pos,
java.lang.String[] phones)
addAddendum in interface com.sun.speech.freetts.lexicon.Lexicon
public static void writeLexicon2(RiCMULexicon lex)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||