|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the center where it listens to the user and farms out stuff to various AppGrammars.
Managed
Fields inherited from interface metaglue.Agent |
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING |
Method Summary | |
void |
activate(String grammarName)
Activate a grammar, so that any public rule in the grammar can be spoken. |
void |
activate(String grammarName,
String ruleName)
Activate a specific rule in a grammar so that it can be spoken |
void |
addAlternative(String grammarName,
String ruleName,
String spokenText)
This adds an alternative to some rule. |
void |
addAlternativeRule(String grammarName,
String ruleName,
String ruleNameToAdd)
Add an alternative rule to the given rule. |
void |
addAlternatives(String grammarName,
String ruleName,
Collection spokenText)
This does the same as the single case, but for a vector of alternatives. |
void |
addDictationListener()
Registers a listener for dictation events. |
void |
addNewRuleAlternatives(String grammarName,
String ruleName)
Adds a new rule to the given grammar as a RuleAlternative. |
void |
deactivate(String grammarName)
Deactivate all the rules in a grammar |
void |
deactivate(String grammarName,
String ruleName)
Deactivate a specific rule in a grammar. |
Vector |
getActiveGrammars()
Gets all the active grammars. |
Vector |
getActiveRules(String grammarName)
Gets all the rules in a grammar that are set active. |
String |
getDictation()
Sets the speech system to dictation mode, where it listens for a single sentence of speech from the user. |
String |
getFile(String grammarName)
Gets the String name of the file of this grammar. |
String |
getGrammar(String grammar,
AgentID whocares)
Get a handle into one of the grammers in the center. |
Vector |
getPublicRules(String grammarName)
Gets all the rules in the grammar that are marked public. |
String |
getRandomSentence(String sGrammarName)
Randomly picks a public rule from a given grammar, and randomly generates a sentence based on that rule. |
String |
getRandomSentence(String sGrammarName,
boolean bPublicRulesOnly)
If bPublicRulesOnly is true, randomly picks a public rule from a given grammar, and randomly generates a sentence based on that rule. |
String |
getRandomSentence(String sGrammarName,
String sRuleName)
Gets a random sentence based on a rule in a given grammar. |
boolean |
hasRule(String grammarName,
String ruleName)
Determines whether the given grammar has the given rule. |
boolean |
isEnabled(String grammarName)
Gets whether or not this grammar is enabled. |
Enumeration |
listRuleNames(String grammarName)
Lists the names of the rules of a given grammar. |
void |
pauseRecognizer()
Pause ViaVoice's recognizer. |
void |
playWav(String wavFile,
boolean sync)
Speech out playing files. |
void |
printRules(String grammarName)
Prints out the rules in a specified grammar to standard output |
String |
processString(String text)
Tries to match a String text with one of Listen's RuleGrammars. |
void |
releaseGrammar(String gname,
AgentID whocares)
Let an owner of a grammar release it. |
void |
requestWakeUp()
Requests that the speech system start listening for public rules. |
void |
requestWakeUp(boolean playattention)
Requests that the speech system start listening for public rules. |
void |
resumeRecognizer()
Resumes ViaVoice's recognizer. |
void |
save(String grammarName)
Calls the save method on the underlying ApplicationGrammar |
void |
say(String text,
boolean sync)
Speech out via local IBM viavoice. |
String |
sayRandomSentence(String sGrammarName)
Picks a random public rule from a given grammar, and says a random sentence from that rule. |
void |
setAlternatives(String grammarName,
String ruleName,
Collection spokenText)
Sets the alternatives of a given rule. |
void |
setDictionFromTypeWriter(boolean b)
|
void |
setTypeWriter(String AgentID)
|
boolean |
sleeping()
|
Methods inherited from interface agentland.resource.Managed |
getNeed, replace, replace, resources, yank, yank |
Methods inherited from interface agentland.util.Good |
getHistory, getHistoryElement, resetHistory |
Methods inherited from interface metaglue.Agent |
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou |
Methods inherited from interface agentland.util.Spy |
tell |
Method Detail |
public String getDictation() throws RemoteException
String
valuepublic void requestWakeUp() throws RemoteException
public void requestWakeUp(boolean playattention) throws RemoteException
playattention
- a boolean
valuepublic String processString(String text) throws RemoteException
text
- a String
valueString
valuepublic void setDictionFromTypeWriter(boolean b) throws RemoteException
public void setTypeWriter(String AgentID) throws RemoteException
public String getGrammar(String grammar, AgentID whocares) throws RemoteException
public void releaseGrammar(String gname, AgentID whocares) throws RemoteException
public void pauseRecognizer() throws RemoteException
public void resumeRecognizer() throws RemoteException
public void playWav(String wavFile, boolean sync) throws RemoteException
wavFile
- a String
valuesync
- block until call completed.RemoteException
- if an error occurspublic void say(String text, boolean sync) throws RemoteException
text
- a String
valuesync
- a boolean
valueRemoteException
- if an error occurspublic Enumeration listRuleNames(String grammarName) throws RemoteException
grammarName
- a String
valueEnumeration
valuepublic void addAlternative(String grammarName, String ruleName, String spokenText) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuespokenText
- a String
valuepublic void addAlternatives(String grammarName, String ruleName, Collection spokenText) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuespokenText
- a Collection
valueaddAlternative(String,String,String)
public void save(String grammarName) throws RemoteException
grammarName
- a String
valueApplicationGrammar
public void activate(String grammarName) throws RemoteException
grammarName
- a String
valuepublic void activate(String grammarName, String ruleName) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuepublic void deactivate(String grammarName) throws RemoteException
grammarName
- a String
valuepublic void deactivate(String grammarName, String ruleName) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuepublic Vector getPublicRules(String grammarName) throws RemoteException
sGrammarName
- a String
valueVector
valuepublic Vector getActiveRules(String grammarName) throws RemoteException
sGrammarName
- a String
valueVector
valuepublic Vector getActiveGrammars() throws RemoteException
Vector
valuepublic String getFile(String grammarName) throws RemoteException
grammarName
- a String
valueString
valuepublic boolean isEnabled(String grammarName) throws RemoteException
grammarName
- a String
valueboolean
valuepublic void addAlternativeRule(String grammarName, String ruleName, String ruleNameToAdd) throws RemoteException
grammarName
- a String
valueruleName
- a String
valueruleNameToAdd
- a String
valuepublic void setAlternatives(String grammarName, String ruleName, Collection spokenText) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuespokenText
- a Collection
valuepublic void addNewRuleAlternatives(String grammarName, String ruleName) throws RemoteException
grammarName
- a String
valueruleName
- a String
valuepublic boolean hasRule(String grammarName, String ruleName) throws RemoteException
grammarName
- a String
valueruleName
- a String
valueboolean
valuepublic void printRules(String grammarName) throws RemoteException
grammarName
- the name of the grammarpublic void addDictationListener() throws RemoteException
RemoteException
- if an error occurspublic String getRandomSentence(String sGrammarName, String sRuleName) throws RemoteException
sGrammarName
- a String
valuesRuleName
- a String
valueString
valuepublic String getRandomSentence(String sGrammarName) throws RemoteException
sGrammarName
- a String
valueString
valuegetRandomSentence(String,boolean)
public String getRandomSentence(String sGrammarName, boolean bPublicRulesOnly) throws RemoteException
sGrammarName
- a String
valuebPublicRulesOnly
- a boolean
valueString
valuepublic String sayRandomSentence(String sGrammarName) throws RemoteException
sGrammarName
- a String
valueString
valuegetRandomSentence(String)
public boolean sleeping() throws RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |