Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.speech.EngineModeDesc | +--javax.speech.recognition.RecognizerModeDesc
RecognizerModeDesc
extends the EngineModeDesc
with properties that are specific to speech recognizers.
A RecognizerModeDesc
inherits engine name,
mode name and Locale
from EngineModeDesc
.
RecognizerModeDesc
adds three features:
Boolean
indicating whether dictation is supported
Like EngineModeDesc
, there are two types of
RecognizerModeDesc
: those created by an application
for use in engine selection, and those created by an
engine which descibe a particular mode of operation of the engine.
Descriptors provided by engines are obtained through the
availableRecognizers
method of the Central
class. These descriptors must have all their features
defined. A descriptor created by an application may make
any or all of the features null
to indictae a "don't care"
value (null features are ignored in engine selection).
[Note: the Boolean
"is running" feature
is a full object rather than a boolean
primitive
so that it can represent true, false and "don't care".]
Applications can modify application-created descriptors in
any way. Applications should never modify the features of
a RecognizerModeDesc
provided by an engine
(i.e. returned by the availableRecognizers
method).
Engine creation is described in the documentation for the
Central
class.
Constructor Summary | |
RecognizerModeDesc()
Construct a descriptor with null values ("don't care")
for all recognizer features. |
|
RecognizerModeDesc(Locale locale,
Boolean dictationGrammarSupported)
Create a RecognizerModeDesc given a Locale
and the dictation flag. |
|
RecognizerModeDesc(String engineName,
String modeName,
Locale locale,
Boolean running,
Boolean dictationGrammarSupported,
SpeakerProfile[] profiles)
Create a fully-specified descriptor. |
Method Summary | |
void | addSpeakerProfile(SpeakerProfile profile)
Add a speaker profile to the SpeakerProfile array. |
boolean | equals(Object anObject)
True if and only if the input parameter is not null
and is a RecognizerModeDesc with equal values of
dictationGrammarSupported and all speaker profiles. |
SpeakerProfile[] | getSpeakerProfilesImpl()
Version of getSpeakerProfiles that performs the
operation. |
SpeakerProfile[] | getSpeakerProfiles()
Returns the list of speaker profiles known to this mode of this recognition engine. |
Boolean | isDictationGrammarSupported()
Test whether this engine mode provides a DictationGrammar .
|
boolean | match(EngineModeDesc require)
Determine whether a RecognizerModeDesc has all the features
defined in the require object. |
void | setDictationGrammarSupported(Boolean dictationGrammarSupported)
Set the dictationGrammarSupported parameter. |
void | setSpeakerProfiles(SpeakerProfile[] speakers)
Set the list of speaker profiles. |
Methods inherited from class javax.speech.EngineModeDesc | |
equals, getEngineName, getLocale, getModeName, getRunning, match, setEngineName, setLocale, setModeName, setRunning |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public RecognizerModeDesc()
null
values ("don't care")
for all recognizer features.public RecognizerModeDesc(Locale locale, Boolean dictationGrammarSupported)
RecognizerModeDesc
given a Locale
and the dictation flag. The speaker profiles array
and other features are all null
.public RecognizerModeDesc(String engineName, String modeName, Locale locale, Boolean running, Boolean dictationGrammarSupported, SpeakerProfile[] profiles)
Method Detail |
public Boolean isDictationGrammarSupported()
DictationGrammar
.
The value may be TRUE
, FALSE
or null
.
A null
value means "don't care".public void setDictationGrammarSupported(Boolean dictationGrammarSupported)
TRUE
, FALSE
or null
.
A null
value means "don't care".public final SpeakerProfile[] getSpeakerProfiles() throws SecurityException
null
if speaker training
is not supported (SpeakerManager
not implemented). Returns
zero-length array if speaker training is supported but no
speaker profiles have been constructed yet.
The list of speaker profiles is the same as returned by the
the listKnownSpeakers
method of SpeakerManager
if this engine is running.
accessSpeakerProfiles
permissionprotected SpeakerProfile[] getSpeakerProfilesImpl()
getSpeakerProfiles
that performs the
operation. This method can be overridden in
sub-classes. However, application can only call
the getSpeakerProfiles
method which
does a security check.
public void setSpeakerProfiles(SpeakerProfile[] speakers)
null
.public void addSpeakerProfile(SpeakerProfile profile)
SpeakerProfile
array.public boolean match(EngineModeDesc require)
RecognizerModeDesc
has all the features
defined in the require
object. Strings in
require
which are either null
or
zero-length ("") are not tested, including those in the
Locale
. All string comparisons are exact (case-sensitive).
The parameters are used as follows:
EngineModeDesc
features are tested
(engine name, mode name, locale).
RecognizerModeDesc
(or sub-class) then
the grammar supported flags and required speakers are tested as follows.
null
require speakers
value is ignored.
Boolean
value if
the required value is null
or if exact boolean match.
public boolean equals(Object anObject)
null
and is a RecognizerModeDesc
with equal values of
dictationGrammarSupported and all speaker profiles.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