Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Interface javax.speech.VocabManager


public abstract interface VocabManager
Interface for management of words used by a speech Engine. The VocabManager for an Engine is returned by the getVocabManager method of the Engine interface. Engines are not required support the VocabManager - the getVocabManager manager may return null.

Words, technically known as tokens, are provided to the vocabulary manager with optional information about their pronunciation, grammatical role and spoken form.

The VocabManager is typically used to provide a speech engine with information on problematic words - usually words for which the engine is unable to guess a pronunciation. For debugging purposes, an Engine may provide a list of words it finds difficult through the listProblemWords method.

Words in the vocabulary manager can be used as tokens in rule grammars for recognizers.

See Also:
getVocabManager, Word

Method Summary
void addWords(Word[] w)
          Add an array of words to the vocabulary.
void addWord(Word w)
          Add a word to the vocabulary.
Word[] getWords(String text)
          Get all words from the vocabulary manager matching text.
Word[] listProblemWords()
          Returns a list of problematic words encountered during a session of using a speech recognizer or synthesizer.
void removeWords(Word[] w)
          Remove an array of words from the vocabulary.
void removeWord(Word w)
          Remove a word from the vocabulary.
 

Method Detail

addWord

public void addWord(Word w)
Add a word to the vocabulary.

addWords

public void addWords(Word[] w)
Add an array of words to the vocabulary.

removeWord

public void removeWord(Word w)
               throws IllegalArgumentException
Remove a word from the vocabulary.
Throws:
IllegalArgumentException - Word is not known to the VocabManager.

removeWords

public void removeWords(Word[] w)
                throws IllegalArgumentException
Remove an array of words from the vocabulary. To remove a set of words it is often useful to
    removeWords(getWords("matching"));
 
Throws:
IllegalArgumentException - Word is not known to the VocabManager.

getWords

public Word[] getWords(String text)
Get all words from the vocabulary manager matching text. Returns null if there are no matches. If text is null all words are returned. This method only returns words that have been added by the addWord methods - it does not provide access to the engine's internal word lists.
Parameters:
text - word requested from VocabManager
Returns:
list of Words matching text

listProblemWords

public Word[] listProblemWords()
Returns a list of problematic words encountered during a session of using a speech recognizer or synthesizer. This return information is intended for development use (so the application can be enhanced to provide vocabulary information). An engine may return null.

If a pronunciation for a problem word is provided through the addWord methods, the engine may remove the word from the problem list.

An engine may (optionally) include its best-guess pronunciations for problem words in the return array allowing the developer to fix (rather than create) the pronunciation.


Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com