Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Recognizer
.
The RecognizerProperties
object is obtained by
calling the getEngineProperties
method of the
Recognizer
(inherited from the Engine
interface).
Because RecognizerProperties
extends the
EngineProperties
interface, it inherits the
following behavior (described in detail in the EngineProperties
documentation):
PropertyVetoException
.
Engine
will apply a change as soon as possible.
PropertyChangeListener
may be attached to
receive property change events.
Per-Speaker Properties
For recognizers that maintain speaker data (recognizers that implement the
SpeakerManager
interface) the RecognizerProperties
should be stored and loaded as part of the speaker data.
Thus, when the current speaker is changed through the
SpeakerManager
interface, the properties of the
new speaker should be loaded.
Method Summary | |
float | getCompleteTimeout()
Get the "CompleteTimeout" property. |
float | getConfidenceLevel()
Get the recognizer's "ConfidenceLevel" property. |
float | getIncompleteTimeout()
Get the "IncompleteTimeout" property. |
int | getNumResultAlternatives()
Get the "NumResultAlternatives" property. |
float | getSensitivity()
Get the "Sensitivity" property. |
float | getSpeedVsAccuracy()
Get the "SpeedVsAccuracy" property. |
boolean | isResultAudioProvided()
Get the "ResultAudioProvided" property.
|
boolean | isTrainingProvided()
Get the TrainingProvided property.
|
void | setCompleteTimeout(float timeout)
Set the CompleteTimeout property in seconds.
|
void | setConfidenceLevel(float confidenceLevel)
Set the recognizer's "ConfidenceLevel" property. |
void | setIncompleteTimeout(float timeout)
Set the IncompleteTimeout property in seconds.
|
void | setNumResultAlternatives(int num)
Set the "NumResultAlternatives" property.
|
void | setResultAudioProvided(boolean audio)
Set the "ResultAudioProvided" property.
|
void | setSensitivity(float sensitivity)
Set the "Sensitivity" property. |
void | setSpeedVsAccuracy(float speedVsAccuracy)
Get the "SpeedVsAccuracy" property. |
void | setTrainingProvided(boolean trainingProvided)
Set the TrainingProvided property.
|
Method Detail |
public float getConfidenceLevel()
public void setConfidenceLevel(float confidenceLevel) throws PropertyVetoException
public float getSensitivity()
public void setSensitivity(float sensitivity) throws PropertyVetoException
Note: some recognizers set the gain automatically during use, or through a setup "Wizard". On these recognizers the sensitivity adjustment should be used only in extreme cases where the automatic settings are not adequate.
public float getSpeedVsAccuracy()
public void setSpeedVsAccuracy(float speedVsAccuracy) throws PropertyVetoException
Why are speed and accuracy a trade-off? A recognizer determines what a user says by testing different possible sequence of words (with legal sequences being defined by the active grammars). If the recognizer tests more sequences it is more likely to find the correct sequence, but there is additional processing so it is slower. Increasing grammar complexity and decreasing the computer power both make this trade-off more important. Conversely, a simpler grammar or more powerful computer make the trade-off less important.
public float getCompleteTimeout()
public void setCompleteTimeout(float timeout) throws PropertyVetoException
CompleteTimeout
property in seconds.
This timeout value determines the length of silence required
following user speech before the recognizer finalizes a result
(with an RESULT_ACCEPTED
or RESULT_REJECTED
event). The complete timeout is used when the speech is a complete
match an active RuleGrammar
. By contrast, the incomplete
timeout is used when the speech is an incomplete match to an active grammar.
A long complete timeout value delays the result completion and therefore makes the computer's response slow. A short complete timeout may lead to an utterance being broken up inappropriately. Reasonable complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds.
public float getIncompleteTimeout()
public void setIncompleteTimeout(float timeout) throws PropertyVetoException
IncompleteTimeout
property in seconds.
The timeout value determines the required length of silence
following user speech after which a recognizer finalizes
a result.
The incomplete timeout applies when the speech prior to the
silence is an incomplete match of the active RuleGrammars
.
In this case, once the timeout is triggered, the partial
result is rejected (with a RESULT_REJECTED
event).
The incomplete timeout also applies when the speech prior to the silence is a complete match of an active grammar, but where it is possible to speak further and still match the grammar. For example, in a grammar for digit sequences for telephone numbers it might be legal to speak either 7 or 10 digits. If the user pauses briefly after speaking 7 digits then the incomplete timeout applies because the user may then continue with a further 3 digits.
By contrast, the complete timeout is used when the speech
is a complete match to an active RuleGrammar
and no further words can be spoken.
A long complete timeout value delays the result completion and therefore makes the computer's response slow. A short incomplete timeout may lead to an utterance being broken up inappropriately.
The incomplete timeout is usually longer than the complete timeout to allow users to pause mid-utterance (for example, to breathe).
public int getNumResultAlternatives()
public void setNumResultAlternatives(int num) throws PropertyVetoException
"NumResultAlternatives"
property.
This property indicates the preferred maximum number of
N-best alternatives in FinalDictationResult
and
FinalRuleResult
objects.
A value of 0 or 1 indicates that the application does not want
alternatives; that is, it only wants the best guess.
Recognizers are not required to provide this number of
alternatives for every result and the number of alternatives
may vary from result to result. Recognizers should only provide
alternative tokens which are considered reasonable guesses: that is,
the alternatives should be above the ConfidenceLevel
set through this interface (unless the Result
is rejected).
Providing alternatives requires additional computing power. Applications should only request the number of alternatives that they are likely to use.
public boolean isResultAudioProvided()
"ResultAudioProvided"
property.
public void setResultAudioProvided(boolean audio) throws PropertyVetoException
"ResultAudioProvided"
property.
If set to true
, the recognizer is requested
to provide audio with FinalResult
objects.
If available, the audio is provided through the
getAudio
methods of the FinalResult
interface.
Some recognizers that can provide audio for a FinalResult
cannot provide audio for all results. Applications need
test audio available individually for results. (For example,
a recognizer might only provide audio for dictation results.)
A Recognizer
that does not provide audio
for any results throws a PropertyVetoException
when an app attempts to set the value to true
.
public boolean isTrainingProvided()
TrainingProvided
property.
public void setTrainingProvided(boolean trainingProvided) throws PropertyVetoException
TrainingProvided
property.
If true
, request a recognizer to provide
training information for FinalResult
objects
through the tokenCorrection
method.
Not all recognizers support training. Also, recognizers
that do support training are not required to support
training data for all results. For example, a recognizer
might only produce training data with dictation results.
A Recognizer
that does not support training
throws a PropertyVetoException
when an app
attempts to set the value to true
.
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