Class Token

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

public class Token extends Object
Contains a parsed token from a Tokenizer.
  • Constructor Details

    • Token

      public Token()
  • Method Details

    • getWhitespace

      public String 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

      public String 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

      public String 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

      public void setWhitespace(String whitespace)
      Sets the whitespace characters of this Token.
      Parameters:
      whitespace - the whitespace character for this token
    • setPrepunctuation

      public void setPrepunctuation(String prepunctuation)
      Sets the prepunctuation characters of this Token.
      Parameters:
      prepunctuation - the prepunctuation characters
    • setPostpunctuation

      public void setPostpunctuation(String postpunctuation)
      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

      public String getWord()
      Returns the string associated with this token.
      Returns:
      the token if it exists; otherwise null
    • setWord

      public void setWord(String word)
      Sets the string of this Token.
      Parameters:
      word - the word for this token
    • toString

      public String toString()
      Converts this token to a string.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this object