Package com.sun.speech.freetts.en.us
Class PronounceableFSM
java.lang.Object
com.sun.speech.freetts.en.us.PronounceableFSM
Implements a finite state machine that checks if a given string
is pronounceable. If it is pronounceable, the method
accept()
will return true.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether we should scan the input string from the front.protected int[]
The transitions of this FSMprotected int
The vocabulary size. -
Constructor Summary
ConstructorsConstructorDescriptionPronounceableFSM
(int vocabularySize, int[] transitions, boolean scanFromFront) Constructs a PronounceableFSM with the given attributes.PronounceableFSM
(URL url, boolean scanFromFront) Constructs a PronounceableFSM with information in the given URL. -
Method Summary
-
Field Details
-
vocabularySize
protected int vocabularySizeThe vocabulary size. -
transitions
protected int[] transitionsThe transitions of this FSM -
scanFromFront
protected boolean scanFromFrontWhether we should scan the input string from the front.
-
-
Constructor Details
-
PronounceableFSM
Constructs a PronounceableFSM with information in the given URL.- Parameters:
url
- the URL that contains the FSM specificationscanFromFront
- indicates whether this FSM should scan the input string from the front, or from the back- Throws:
IOException
-
PronounceableFSM
public PronounceableFSM(int vocabularySize, int[] transitions, boolean scanFromFront) Constructs a PronounceableFSM with the given attributes.- Parameters:
vocabularySize
- the vocabulary size of the FSMtransitions
- the transitions of the FSMscanFromFront
- indicates whether this FSM should scan the input string from the front, or from the back
-
-
Method Details
-
accept
Checks to see if this finite state machine accepts the given input string.- Parameters:
inputString
- the input string to be tested- Returns:
- true if this FSM accepts, false if it rejects
-