Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
public void addWord(Word w)
public void addWords(Word[] w)
public void removeWord(Word w) throws IllegalArgumentException
public void removeWords(Word[] w) throws IllegalArgumentException
removeWords(getWords("matching"));
public Word[] getWords(String text)
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.
text
- word requested from VocabManager
Words
matching text
public Word[] listProblemWords()
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