Package com.sun.speech.freetts
Class Token
java.lang.Object
com.sun.speech.freetts.Token
Contains a parsed token from a Tokenizer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the line of this token in the original text.int
Returns the position of this token in the original input text.Returns the postpunctuation characters of this Token.Returns the prepunctuation characters of this Token.Returns the whitespace characters of this Token.getWord()
Returns the string associated with this token.void
setLineNumber
(int lineNumber) Set the line of this token in the original text.void
setPosition
(int position) Sets the position of the token in the original input text.void
setPostpunctuation
(String postpunctuation) Sets the postpunctuation characters of this Token.void
setPrepunctuation
(String prepunctuation) Sets the prepunctuation characters of this Token.void
setWhitespace
(String whitespace) Sets the whitespace characters of this Token.void
Sets the string of this Token.toString()
Converts this token to a string.
-
Constructor Details
-
Token
public Token()
-
-
Method Details
-
getWhitespace
Returns the whitespace characters of this Token.- Returns:
- the whitespace characters of this Token; null if this Token does not use whitespace characters
-
getPrepunctuation
Returns the prepunctuation characters of this Token.- Returns:
- the prepunctuation characters of this Token; null if this Token does not use prepunctuation characters
-
getPostpunctuation
Returns the postpunctuation characters of this Token.- Returns:
- the postpunctuation characters of this Token; null if this Token does not use postpunctuation characters
-
getPosition
public int getPosition()Returns the position of this token in the original input text.- Returns:
- the position of this token in the original input text
-
getLineNumber
public int getLineNumber()Returns the line of this token in the original text.- Returns:
- the line of this token in the original text
-
setWhitespace
Sets the whitespace characters of this Token.- Parameters:
whitespace
- the whitespace character for this token
-
setPrepunctuation
Sets the prepunctuation characters of this Token.- Parameters:
prepunctuation
- the prepunctuation characters
-
setPostpunctuation
Sets the postpunctuation characters of this Token.- Parameters:
postpunctuation
- the postpunctuation characters
-
setPosition
public void setPosition(int position) Sets the position of the token in the original input text.- Parameters:
position
- the position of the input text
-
setLineNumber
public void setLineNumber(int lineNumber) Set the line of this token in the original text.- Parameters:
lineNumber
- the line of this token in the original text
-
getWord
Returns the string associated with this token.- Returns:
- the token if it exists; otherwise null
-
setWord
Sets the string of this Token.- Parameters:
word
- the word for this token
-
toString
Converts this token to a string.
-