Package com.sun.speech.freetts.diphone

# Class DiphoneUnitSelector

java.lang.Object
com.sun.speech.freetts.diphone.DiphoneUnitSelector

All Implemented Interfaces:
  `UtteranceProcessor`

public class DiphoneUnitSelector extends Object implements UtteranceProcessor
Generates the Unit Relation of an Utterance from the Segment Relation.

## Constructor Summary

Constructors
Constructor
Description
`DiphoneUnitSelector(URL url)`
Constructs a DiphoneUnitSelector.

## Method Summary

Modifier and Type
Method
Description
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### DiphoneUnitSelector

public DiphoneUnitSelector(URL url) throws IOException
Constructs a DiphoneUnitSelector.

Parameters:
  `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 database1
Throws:
  `IOException` - if an error occurs while loading the database

## Method Details

### getSampleInfo

public SampleInfo getSampleInfo()
Get the sample info for the underlying database.

Returns:
  the sample info object

### processUtterance

public void processUtterance(Utterance utterance) throws ProcessException
Generates the Unit Relation from the Segment Relation.

Specified by:
  `processUtterance` in interface `UtteranceProcessor`
Parameters:
  `utterance` - the utterance to generate the Unit Relation
Throws:
  `ProcessException` - if an IOException is thrown during the processing of the utterance

### toString

public String toString()
Returns a string representation of this object.

Overrides:
  `toString` in class `Object`
Returns:
  a string representation of this object