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

Class javax.speech.recognition.RecognizerModeDesc

java.lang.Object
  |
  +--javax.speech.EngineModeDesc
        |
        +--javax.speech.recognition.RecognizerModeDesc

public class RecognizerModeDesc
extends EngineModeDesc
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:

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.

See Also:
Central, SpeakerManager, SpeakerProfile

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

RecognizerModeDesc

public RecognizerModeDesc()
Construct a descriptor with null values ("don't care") for all recognizer features.

RecognizerModeDesc

public RecognizerModeDesc(Locale locale,
                          Boolean dictationGrammarSupported)
Create a RecognizerModeDesc given a Locale and the dictation flag. The speaker profiles array and other features are all null.

RecognizerModeDesc

public RecognizerModeDesc(String engineName,
                          String modeName,
                          Locale locale,
                          Boolean running,
                          Boolean dictationGrammarSupported,
                          SpeakerProfile[] profiles)
Create a fully-specified descriptor.
Method Detail

isDictationGrammarSupported

public Boolean isDictationGrammarSupported()
Test whether this engine mode provides a DictationGrammar. The value may be TRUE, FALSE or null. A null value means "don't care".

setDictationGrammarSupported

public void setDictationGrammarSupported(Boolean dictationGrammarSupported)
Set the dictationGrammarSupported parameter. The value may be TRUE, FALSE or null. A null value means "don't care".

getSpeakerProfiles

public final SpeakerProfile[] getSpeakerProfiles()
                                                                  throws SecurityException
Returns the list of speaker profiles known to this mode of this recognition engine. Returns 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.

Throws:
SecurityException - if the application does not have accessSpeakerProfiles permission
See Also:
listKnownSpeakers

getSpeakerProfilesImpl

protected SpeakerProfile[] getSpeakerProfilesImpl()
Version of 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.

See Also:
getSpeakerProfiles

setSpeakerProfiles

public void setSpeakerProfiles(SpeakerProfile[] speakers)
Set the list of speaker profiles. May be null.

addSpeakerProfile

public void addSpeakerProfile(SpeakerProfile profile)
Add a speaker profile to the SpeakerProfile array.

match

public boolean match(EngineModeDesc require)
Determine whether a 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:

Overrides:
match in class EngineModeDesc

equals

public 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.
Overrides:
equals in class EngineModeDesc

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