public class CMULexicon extends LexiconImpl
Modifier and Type | Field and Description |
---|---|
private static String |
GLIDES_LIQUIDS
Glides/Liquids
|
private static String |
NASALS
Nasals
|
private static String |
VOICED_OBSTRUENTS
Voiced Obstruents
|
private static String |
VOWELS
Vowels
|
tokenizeOnLoad, tokenizeOnLookup
Constructor and Description |
---|
CMULexicon()
Creates the default CMU Lexicon which is a binary lexicon
|
CMULexicon(String basename)
Creates the CMU Lexicon which is a binary lexicon
|
CMULexicon(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
|
Modifier and Type | Method and Description |
---|---|
static 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 |
hasVowel(List phones)
Determines if there is a vowel in given list of phones.
|
protected static boolean |
hasVowel(String[] phones,
int index)
Determines if there is a vowel in the remainder of the array,
starting at the given index.
|
protected static boolean |
isSilence(String phone)
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 |
isVowel(String phone)
Determines if the given phone is a vowel
|
static void |
main(String[] args)
Provides test code for the CMULexicon.
|
addAddendum, compare, createLexicon, dumpBinary, fixPartOfSpeech, getPhones, getPhones, getPhones, getPhones, getPhones, isLoaded, load, loadTextLexicon, parseAndAdd, removeAddendum, setLexiconParameters
private static final String VOWELS
private static final String GLIDES_LIQUIDS
private static final String NASALS
private static final String VOICED_OBSTRUENTS
public CMULexicon(URL compiledURL, URL addendaURL, URL letterToSoundURL, boolean binary)
compiledURL
- the compiled database is loaded from hereaddendaURL
- the database addenda is loaded from hereletterToSoundURL
- the letter to sound rules are loaded
from herebinary
- if true
the input data are loaded as
binary ; otherwise if false
the input
data are loaded as text.public CMULexicon()
public CMULexicon(String basename)
basename
- the basename for the lexicon.public CMULexicon(String basename, boolean useBinaryIO)
public static CMULexicon getInstance(boolean useBinaryIO) throws IOException
useBinaryIO
- if true use binary IO to load DBIOException
- if problems occurred while reading the datapublic static CMULexicon getInstance(String basename, boolean useBinaryIO) throws IOException
useBinaryIO
- if true use binary IO to load DBIOException
- if problems occurred while reading the datapublic boolean isSyllableBoundary(List syllablePhones, String[] wordPhones, int currentWordPhone)
syllablePhones
- the phones in the current syllable so farwordPhones
- the phones for the whole wordcurrentWordPhone
- the word phone in questiontrue
if the word phone in question is on a
syllable boundary; otherwise false
.protected static boolean isSilence(String phone)
phone
- the phone to testtrue
if the phone represents a silent
phone; otherwise false
.protected static boolean hasVowel(String[] phones, int index)
phones
- the set of phones to checkindex
- start checking at this indextrue
if a vowel is found;
otherwise false
.protected static boolean hasVowel(List phones)
phones
- the list of phonestrue
if a vowel is found;
otherwise false
.protected static boolean isVowel(String phone)
phone
- the phone to testtrue
if phone is a vowel
otherwise false
.protected static int getSonority(String phone)
phone
- the phone of interestWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses