public class DiphoneUnitSelector extends Object implements UtteranceProcessor
Modifier and Type | Field and Description |
---|---|
private DiphoneUnitDatabase |
diphoneDatabase |
Constructor and Description |
---|
DiphoneUnitSelector(URL url)
Constructs a DiphoneUnitSelector.
|
Modifier and Type | Method and Description |
---|---|
private Item |
createUnitItem(Relation unitRelation,
String diphoneName,
int targetEnd,
int unitPart)
Returns a new Item (a Unit) in the given Relation, and
sets the new Item to the given diphone name, target end,
unit entry (index in the database), and unit part (1 or 2).
|
private void |
createUnitRelation(Utterance utterance)
Creates the Unit Relation in the given utterance from
the diphone units and their some associated information from
the units database.
|
SampleInfo |
getSampleInfo()
Get the sample info for the underlying database.
|
void |
processUtterance(Utterance utterance)
Generates the Unit Relation from the Segment Relation.
|
String |
toString()
Returns a string representation of this object.
|
private DiphoneUnitDatabase diphoneDatabase
public DiphoneUnitSelector(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 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 utteranceprivate void createUnitRelation(Utterance utterance)
utterance
- the utterance that gets the new unit relationprivate Item createUnitItem(Relation unitRelation, String diphoneName, int targetEnd, int unitPart)
unitRelation
- the relation that gets the new itemdiphoneName
- the name of the dipohonetargetEnd
- the time at the end of this unitunitPart
- the item can be in the first(1) or second part (2)WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses