Package com.sun.speech.freetts

# Class Segmenter

java.lang.Object
com.sun.speech.freetts.Segmenter

All Implemented Interfaces:
  `UtteranceProcessor`

public class Segmenter extends Object implements UtteranceProcessor
Annotates an utterance with `Relation.SYLLABLE`, `Relation.SYLLABLE_STRUCTURE`, and `Relation.SEGMENT`. To determine stress, the `isStressed` method relies upon a phone ending in the number "1". Subclasses should override `isStressed` and `deStress` if stresses are determined in other ways.

See Also:
  - `Relation.SEGMENT`
  - `Relation.SYLLABLE`
  - `Relation.SYLLABLE_STRUCTURE`

## Constructor Summary

Constructors
Constructor
Description
`Segmenter()`

## Method Summary

Modifier and Type
Method
Description
`protected String`
`deStress(String phone)`
Converts stressed phoneme to regular phoneme.
`protected boolean`
`isStressed(String phone)`
Determines if the given phonemene is stressed.
`void`
`processUtterance(Utterance utterance)`
Annotates an utterance with `Relation.SYLLABLE`, `Relation.SYLLABLE_STRUCTURE`, and `Relation.SEGMENT`.
`String`
`toString()`
Returns the simple name of this class.

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

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

## Constructor Details

### Segmenter

public Segmenter()

## Method Details

### processUtterance

public void processUtterance(Utterance utterance) throws ProcessException
Annotates an utterance with `Relation.SYLLABLE`, `Relation.SYLLABLE_STRUCTURE`, and `Relation.SEGMENT`.

Specified by:
  `processUtterance` in interface `UtteranceProcessor`
Parameters:
  `utterance` - the utterance to process/tokenize
Throws:
  `ProcessException` - if an IOException is thrown during the processing of the utterance
See Also:
  - `Relation.SEGMENT`
  - `Relation.SYLLABLE`
  - `Relation.SYLLABLE_STRUCTURE`

### isStressed

protected boolean isStressed(String phone)
Determines if the given phonemene is stressed. To determine stress, this method relies upon a phone ending in the number "1". Subclasses should override this method if stresses are determined in other ways.

Parameters:
  `phone` - the phone to check
Returns:
  true if the phone is stressed, otherwise false

### deStress

protected String deStress(String phone)
Converts stressed phoneme to regular phoneme. This method merely removes the last character of the phone. Subclasses should override this if another method is to be used.

Parameters:
  `phone` - the phone to convert
Returns:
  de-stressed phone

### toString

public String toString()
Returns the simple name of this class.

Overrides:
  `toString` in class `Object`
Returns:
  the simple name of this class