public class ClusterUnitSelector extends Object implements UtteranceProcessor
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ClusterUnitSelector.Viterbi
Provides support for the Viterbi Algorithm.
|
(package private) static class |
ClusterUnitSelector.ViterbiCandidate
Represents a candidate for the Viterbi algorthm.
|
(package private) static class |
ClusterUnitSelector.ViterbiPath
Describes a Viterbi path.
|
(package private) static class |
ClusterUnitSelector.ViterbiPoint
Represents a point in the Viterbi path.
|
Modifier and Type | Field and Description |
---|---|
private ClusterUnitDatabase |
clunitDB |
private static PathExtractor |
DNAME |
private static Logger |
LOGGER
Logger instance.
|
private ClusterUnitNamer |
unitNamer |
Constructor and Description |
---|
ClusterUnitSelector(URL url)
Constructs a ClusterUnitSelector.
|
ClusterUnitSelector(URL url,
ClusterUnitNamer unitNamer)
Constructs a ClusterUnitSelector.
|
Modifier and Type | Method and Description |
---|---|
SampleInfo |
getSampleInfo()
Get the sample info for the underlying database.
|
void |
processUtterance(Utterance utterance)
Generates the Unit Relation from the Segment Relation.
|
protected void |
setUnitName(Item seg)
Sets the cluster unit name given the segment.
|
private String |
stripQuotes(String s)
Strips quotes from the given string.
|
String |
toString()
Retrieves the string representation of this object.
|
private static final PathExtractor DNAME
private ClusterUnitDatabase clunitDB
private ClusterUnitNamer unitNamer
public ClusterUnitSelector(URL url) throws IOException
url
- the URL for the unit database. If the URL path ends
with a '.bin' it is assumed that the DB is a binary database,
otherwise, its assumed that its a text database1IOException
- if an error occurs while loading the
databasepublic ClusterUnitSelector(URL url, ClusterUnitNamer unitNamer) throws IOException
url
- the URL for the unit database. If the URL path ends
with a '.bin' it is assumed that the DB is a binary database,
otherwise, its assumed that its a text database1unitNamer
- an optional unit namer, specifying how the cluster
units are called in the voice database referenced by url. If this is null,
an ldom unit naming scheme will be used (e.g., 'ae_afternoon' for the
phoneme 'ae' in the word 'afternoon'.IOException
- if an error occurs while loading the
databasepublic SampleInfo getSampleInfo()
public void processUtterance(Utterance utterance) throws ProcessException
processUtterance
in interface UtteranceProcessor
utterance
- the utterance to generate the Unit RelationProcessException
- if an IOException is thrown during the
processing of the utteranceprotected void setUnitName(Item seg)
seg
- the segment item that gets the nameprivate String stripQuotes(String s)
s
- the string to strip quotes fromWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses