Package com.sun.speech.freetts
Class Segmenter
- java.lang.Object
-
- com.sun.speech.freetts.Segmenter
-
- All Implemented Interfaces:
UtteranceProcessor
public class Segmenter extends java.lang.Object implements UtteranceProcessor
Annotates an utterance withRelation.SYLLABLE,Relation.SYLLABLE_STRUCTURE, andRelation.SEGMENT. To determine stress, theisStressedmethod relies upon a phone ending in the number "1". Subclasses should overrideisStressedanddeStressif stresses are determined in other ways.
-
-
Constructor Summary
Constructors Constructor Description Segmenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringdeStress(java.lang.String phone)Converts stressed phoneme to regular phoneme.protected booleanisStressed(java.lang.String phone)Determines if the given phonemene is stressed.voidprocessUtterance(Utterance utterance)Annotates an utterance withRelation.SYLLABLE,Relation.SYLLABLE_STRUCTURE, andRelation.SEGMENT.java.lang.StringtoString()Returns the simple name of this class.
-
-
-
Method Detail
-
processUtterance
public void processUtterance(Utterance utterance) throws ProcessException
Annotates an utterance withRelation.SYLLABLE,Relation.SYLLABLE_STRUCTURE, andRelation.SEGMENT.- Specified by:
processUtterancein interfaceUtteranceProcessor- 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(java.lang.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 java.lang.String deStress(java.lang.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 java.lang.String toString()
Returns the simple name of this class.- Overrides:
toStringin classjava.lang.Object- Returns:
- the simple name of this class
-
-