public class AllophoneSet extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AllophoneSet.Stress
Constants for Stress markers
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkAllophoneSyntax(String allophoneString)
Check whether the given allophone string has a correct syntax according to this allophone set.
|
Allophone |
getAllophone(String ph)
Get the Allophone with the given name
|
Set<String> |
getAllophoneNames()
This returns the names of all allophones contained in this AllophoneSet, as a Set of Strings
|
static AllophoneSet |
getAllophoneSet(InputStream inStream,
String identifier)
Return the allophone set that can be read from the given input stream, identified by the given identifier.
|
static AllophoneSet |
getAllophoneSet(String filename)
Return the allophone set specified by the given filename.
|
static AllophoneSet |
getAllophoneSetById(String identifier)
Get a previously loaded allophone set by its identifier.
|
String |
getIgnoreChars()
Obtain the ignore chars in this AllophoneSet Default: "',-"
|
Locale |
getLocale() |
String |
getPhoneFeature(String ph,
String featureName)
For the Allophone with name ph, return the value of the named feature.
|
Set<String> |
getPhoneFeatures()
Get the list of available phone features for this allophone set.
|
String[] |
getPossibleFeatureValues(String featureName)
For the given feature name, get the list of all possible values that the feature can take in this allophone set.
|
Allophone |
getSilence()
Obtain the silence allophone in this AllophoneSet
|
static boolean |
hasAllophoneSet(String identifier)
Determine whether the registry of previously loaded allophone sets already contains an allophone set with the given
identifier.
|
String |
splitAllophoneString(String allophoneString)
Split allophone string into a list of allophone symbols.
|
List<String> |
splitIntoAllophoneList(String allophonesString)
Split allophone string into a list of allophone symbols, preserving all stress and syllable boundaries that may be present
|
Allophone[] |
splitIntoAllophones(String allophoneString)
Split a phonetic string into allophone symbols.
|
String |
syllabify(String phoneString)
Syllabify a string of allophones.
|
public static AllophoneSet getAllophoneSet(String filename) throws MaryConfigurationException
filename
- filenameMaryConfigurationException
- if no allophone set can be loaded from the given file.public static boolean hasAllophoneSet(String identifier)
getAllophoneSetById(String)
with the same identifier will return
a non-null Allophone set.identifier
- the identifier of the allophone set to test.public static AllophoneSet getAllophoneSetById(String identifier)
identifier
- the identifier of the allophone setpublic static AllophoneSet getAllophoneSet(InputStream inStream, String identifier) throws MaryConfigurationException
inStream
- an open stream from which the allophone set can be loaded. it will be closed when this method returns.identifier
- a unique identifier for this allophone set.MaryConfigurationException
- if no allophone set can be loaded from the given file.public Locale getLocale()
public Allophone getAllophone(String ph)
ph
- name of Allophone to getIllegalArgumentException
- if the Allophone is not found in the AllophoneSetpublic Allophone getSilence()
public String getIgnoreChars()
public String getPhoneFeature(String ph, String featureName)
ph
- phfeatureName
- feature namepublic Set<String> getPhoneFeatures()
public String[] getPossibleFeatureValues(String featureName)
featureName
- featureNameIllegalArgumentException
- if featureName is not a known feature name.public Set<String> getAllophoneNames()
public Allophone[] splitIntoAllophones(String allophoneString)
allophoneString
- the phonetic string to splitIllegalArgumentException
- if the allophoneString contains unknown symbols.public String splitAllophoneString(String allophoneString)
allophoneString
- allophoneStringIllegalArgumentException
- if the string contains illegal symbols.public List<String> splitIntoAllophoneList(String allophonesString)
allophonesString
- allophonesStringIllegalArgumentException
- if allophoneString contains a symbol for which no Allophone can be foundpublic boolean checkAllophoneSyntax(String allophoneString)
allophoneString
- allophoneStringpublic String syllabify(String phoneString) throws IllegalArgumentException
The syllabification algorithm itself follows the Core Syllabification Principle (CSP) from
G.N. Clements (1990) "The role of the sonority cycle in core syllabification." In: J. Kingston & M.E. Beckman (Eds.), Papers in Laboratory Phonology I: Between the Grammar and Physics of Speech, Ch. 17, pp. 283-333, Cambridge University Press.
phoneString
- phoneStringIllegalArgumentException
- if the phoneString is empty or contains a symbol that satisfies none of the following conditions:
AllophoneSet.Stress
), or
-
)Copyright © 2000–2016 DFKI GmbH. All rights reserved.