speech
Class AppGrammarAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--speech.AppGrammarAgent
- All Implemented Interfaces:
- Agent, AppGrammar, Good, Managed, MetagluePrimitives, Remote, RemoteTagsListener, Serializable, Speakable, Spy
- public class AppGrammarAgent
- extends ManagedAgent
- implements AppGrammar, RemoteTagsListener, Speakable
This is a Metaglue-ized interface to my ApplicationGrammar class,
and thereby to the rule and dictation grammars in the Java Speech
API (JSAPI beta v0.7).
This interface provides all the basic functionality of the JSAPI
RuleGrammar class but omits for the time being anything esoteric.
For more information on the Java Speech Grammar Format (JSGF)
specification, in which you write your grammars, see:
http://java.sun.com/products/java-media/speech/forDevelopers/JSGF
Your JSGF grammar files should all be located somewhere in _one_ of
your root classpath directories. You can put them in whatever
packages you like, but they must all be in the same root classpath
directory. (This is due to the implementation of JSAPI's import
mechanism.)
- See Also:
ManagedAgent
,
AppGrammar
,
RemoteTagsListener
,
Speakable
, Serialized Form
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
Methods inherited from interface agentland.util.Spy |
tell |
AppGrammarAgent
public AppGrammarAgent()
throws RemoteException
- Set me up!
replace
public void replace(Resource old_r,
Resource new_r)
- If we change GrammarCenters, we need to load up our grammar in the
new center and get things going like they were in the old center.
- Specified by:
replace
in interface Managed
- Overrides:
replace
in class ManagedAgent
acceptedTagsResult
public void acceptedTagsResult(Hashtable tags)
throws RemoteException
- This is what is called by the GrammarCenter. We pass it on
to all our friends and lovers.
- Specified by:
acceptedTagsResult
in interface RemoteTagsListener
addTagsListener
public void addTagsListener(RemoteTagsListener suppliedListener)
throws RemoteException
- Specified by:
addTagsListener
in interface AppGrammar
save
public void save()
throws RemoteException
- Specified by:
save
in interface AppGrammar
addAlternative
public void addAlternative(String ruleName,
String spokenText)
throws RemoteException
- Specified by:
addAlternative
in interface AppGrammar
addAlternatives
public void addAlternatives(String ruleName,
Collection spokenText)
throws RemoteException
- Specified by:
addAlternatives
in interface AppGrammar
listRuleNames
public Enumeration listRuleNames()
throws RemoteException
- Specified by:
listRuleNames
in interface AppGrammar
printRules
public void printRules()
throws RemoteException
- Specified by:
printRules
in interface AppGrammar
addTagsListener
public void addTagsListener(String tag,
TagsListener suppliedListener)
throws RemoteException
requestWakeUp
public void requestWakeUp()
throws RemoteException
- Specified by:
requestWakeUp
in interface AppGrammar
requestWakeUp
public void requestWakeUp(boolean playattention)
throws RemoteException
- Specified by:
requestWakeUp
in interface AppGrammar
setActive
public void setActive(boolean active)
throws RemoteException
- Description copied from interface:
AppGrammar
- true = activate, false = deactivate
- Specified by:
setActive
in interface AppGrammar
activate
public void activate()
throws RemoteException
- Description copied from interface:
AppGrammar
- Make folks able to say our stuff!
- Specified by:
activate
in interface AppGrammar
activate
public void activate(String ruleName)
throws RemoteException
- Description copied from interface:
AppGrammar
- Activate given rule.
- Specified by:
activate
in interface AppGrammar
deactivate
public void deactivate()
throws RemoteException
- Specified by:
deactivate
in interface AppGrammar
deactivate
public void deactivate(String ruleName)
throws RemoteException
- Specified by:
deactivate
in interface AppGrammar
getActiveRules
public Vector getActiveRules()
throws RemoteException
- Specified by:
getActiveRules
in interface AppGrammar
getName
public String getName()
throws RemoteException
- Specified by:
getName
in interface AppGrammar
getFile
public String getFile()
throws RemoteException
- Specified by:
getFile
in interface AppGrammar
isEnabled
public boolean isEnabled()
throws RemoteException
- Specified by:
isEnabled
in interface AppGrammar
addAlternativeRule
public void addAlternativeRule(String ruleName,
String ruleNameToAdd)
throws RemoteException
- Specified by:
addAlternativeRule
in interface AppGrammar
setAlternatives
public void setAlternatives(String ruleName,
Collection spokenText)
throws RemoteException
- Specified by:
setAlternatives
in interface AppGrammar
addNewRuleAlternatives
public void addNewRuleAlternatives(String ruleName)
throws RemoteException
- Specified by:
addNewRuleAlternatives
in interface AppGrammar
hasRule
public boolean hasRule(String ruleName)
throws RemoteException
- Specified by:
hasRule
in interface AppGrammar
toSpeech
public String toSpeech()
- Returns a String that can be spoken by a speech synthesizer.
- Specified by:
toSpeech
in interface Speakable
- Returns:
- a
String
value