Package com.sun.speech.freetts.en.us
Class CMULexicon
java.lang.Object
com.sun.speech.freetts.lexicon.LexiconImpl
com.sun.speech.freetts.en.us.CMULexicon
- All Implemented Interfaces:
Lexicon
- Direct Known Subclasses:
CMUTimeLexicon
Provides a CMU lexicon-specific implementation of a Lexicon that is
stored in a text file.
-
Field Summary
Fields inherited from class com.sun.speech.freetts.lexicon.LexiconImpl
tokenizeOnLoad, tokenizeOnLookup
-
Constructor Summary
ConstructorsConstructorDescriptionCreates the default CMU Lexicon which is a binary lexiconCMULexicon
(String basename) Creates the CMU Lexicon which is a binary lexiconCMULexicon
(String basename, boolean useBinaryIO) CMULexicon
(URL compiledURL, URL addendaURL, URL letterToSoundURL, boolean binary) Creates a CMULexicon based upon the given compiled and addenda DBs and the given letter to sound rules -
Method Summary
Modifier and TypeMethodDescriptionstatic CMULexicon
getInstance
(boolean useBinaryIO) Get the CMULexicon.static CMULexicon
getInstance
(String basename, boolean useBinaryIO) Get the CMULexicon.protected static int
getSonority
(String phone) Determines the sonority for the given phone.protected static boolean
Determines if there is a vowel in the remainder of the array, starting at the given index.protected static boolean
Determines if there is a vowel in given list of phones.protected static boolean
Determines if the given phone represents a silent phone.boolean
isSyllableBoundary
(List syllablePhones, String[] wordPhones, int currentWordPhone) Determines if the currentPhone represents a new syllable boundary.protected static boolean
Determines if the given phone is a vowelstatic void
Provides test code for the CMULexicon.Methods inherited from class com.sun.speech.freetts.lexicon.LexiconImpl
addAddendum, compare, createLexicon, dumpBinary, fixPartOfSpeech, getPhones, getPhones, getPhones, getPhones, getPhones, isLoaded, load, loadTextLexicon, parseAndAdd, removeAddendum, setLexiconParameters
-
Constructor Details
-
CMULexicon
Creates a CMULexicon based upon the given compiled and addenda DBs and the given letter to sound rules- Parameters:
compiledURL
- the compiled database is loaded from hereaddendaURL
- the database addenda is loaded from hereletterToSoundURL
- the letter to sound rules are loaded from herebinary
- iftrue
the input data are loaded as binary ; otherwise iffalse
the input data are loaded as text.
-
CMULexicon
public CMULexicon()Creates the default CMU Lexicon which is a binary lexicon -
CMULexicon
Creates the CMU Lexicon which is a binary lexicon- Parameters:
basename
- the basename for the lexicon.
-
CMULexicon
-
-
Method Details
-
getInstance
Get the CMULexicon.- Parameters:
useBinaryIO
- if true use binary IO to load DB- Throws:
IOException
- if problems occurred while reading the data
-
getInstance
Get the CMULexicon.- Parameters:
useBinaryIO
- if true use binary IO to load DB- Throws:
IOException
- if problems occurred while reading the data
-
isSyllableBoundary
Determines if the currentPhone represents a new syllable boundary.- Parameters:
syllablePhones
- the phones in the current syllable so farwordPhones
- the phones for the whole wordcurrentWordPhone
- the word phone in question- Returns:
true
if the word phone in question is on a syllable boundary; otherwisefalse
.
-
isSilence
Determines if the given phone represents a silent phone.- Parameters:
phone
- the phone to test- Returns:
true
if the phone represents a silent phone; otherwisefalse
.
-
hasVowel
Determines if there is a vowel in the remainder of the array, starting at the given index.- Parameters:
phones
- the set of phones to checkindex
- start checking at this index- Returns:
true
if a vowel is found; otherwisefalse
.
-
hasVowel
Determines if there is a vowel in given list of phones.- Parameters:
phones
- the list of phones- Returns:
true
if a vowel is found; otherwisefalse
.
-
isVowel
Determines if the given phone is a vowel- Parameters:
phone
- the phone to test- Returns:
true
if phone is a vowel otherwisefalse
.
-
getSonority
Determines the sonority for the given phone.- Parameters:
phone
- the phone of interest- Returns:
- an integer that classifies phone transitions
-
main
Provides test code for the CMULexicon.
Usage:
com.sun.speech.freetts.en.us.CMULexicon [options] Where options is any combination of: -src path -dest path -generate_binary [base_name] -compare -showtimes
-