Package com.sun.speech.freetts.en.us

# Class PronounceableFSM

java.lang.Object
com.sun.speech.freetts.en.us.PronounceableFSM

Direct Known Subclasses:
  `PrefixFSM`, `SuffixFSM`

public class PronounceableFSM extends Object
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

Fields
Modifier and Type
Field
Description
`protected boolean`
`scanFromFront`
Whether we should scan the input string from the front.
`protected int[]`
`transitions`
The transitions of this FSM
`protected int`
`vocabularySize`
The vocabulary size.

## Constructor Summary

Constructors
Constructor
Description
`PronounceableFSM(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

Modifier and Type
Method
Description
`boolean`
`accept(String inputString)`
Checks to see if this finite state machine accepts the given input string.

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

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

## Field Details

### vocabularySize

protected int vocabularySize
The vocabulary size.

### transitions

protected int[] transitions
The transitions of this FSM

### scanFromFront

protected boolean scanFromFront
Whether we should scan the input string from the front.

## Constructor Details

### PronounceableFSM

public PronounceableFSM(URL url, boolean scanFromFront) throws IOException
Constructs a PronounceableFSM with information in the given URL.

Parameters:
  `url` - the URL that contains the FSM specification
  `scanFromFront` - 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 FSM
  `transitions` - the transitions of the FSM
  `scanFromFront` - indicates whether this FSM should scan the input string from the front, or from the back

## Method Details

### accept

public boolean accept(String inputString)
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