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.recognition.Rule | +--javax.speech.recognition.RuleTag
RuleTag
attaches a tag to a contained Rule
object.
A tag is a string attached to any Rule
entity. The tag
does not affect the recognition of a RuleGrammar
in which
it is used. Instead tags are used to embed information into a grammar
that helps with processing of recognition results.
Tags are
RuleGrammar
,
RuleParse
objects).
RuleTag
class assumes that all such string
handling is handled separately. The exception is toString
which is required to produce a JSGF-compliant string, and so escapes
special characters as required.
"{}"
.
This tag is defined to be the zero-length string, ""
.
A null
tag is converted to a zero-length string.
Field Summary | |
Rule | rule
The tagged rule. |
String | tag
The tag string for the rule. |
Constructor Summary | |
RuleTag(Rule rule,
String tag)
Construct a RuleTag with for Rule object with a tag string.
|
|
RuleTag()
Empty constructor sets the rule and tag to null . |
Method Summary | |
Rule | copy()
Return a deep copy of this rule. |
Rule | getRule()
Returns the Rule object being tagged. |
String | getTag()
Returns the tag string. |
void | setRule(Rule rule)
Set the Rule object to be tagged. |
void | setTag(String tag)
Set the tag string for the Rule. |
String | toString()
Return a String representing the RuleTag object in
partial Java Speech Grammar Format.
|
Methods inherited from class javax.speech.recognition.Rule | |
copy, toString |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected Rule rule
protected String tag
Constructor Detail |
public RuleTag(Rule rule, String tag)
RuleTag
with for Rule
object with a tag string.
The method assumes that pre-processing of JSGF tags is complete (the leading
and trailing curly braces are removed, escape characters are removed).
rule
- the rule being tagged
tag
- the tag stringpublic RuleTag()
null
.Method Detail |
public Rule getRule()
Rule
object being tagged.public void setRule(Rule rule)
Rule
object to be tagged.public String getTag()
public void setTag(String tag)
public Rule copy()
Rule.copy
documentation for an explanation of deep copy.public String toString()
String
representing the RuleTag
object in
partial Java Speech Grammar Format.
Any backslash or closing angle brackets within the tag will be
properly escaped by a backslash. If required, the rule contained
within the RuleTag
will enclosed by parentheses.
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