|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.interpreter.grammar.identifier.SrgsAbnfGrammarIdentifier
public final class SrgsAbnfGrammarIdentifier
This class implements the GrammarIdentifier interface. An instance
of this class is able to identify a SRGS grammar with ABNF format.
The mime type of the accepted grammar is application/srgs.
Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/
| Constructor Summary | |
|---|---|
SrgsAbnfGrammarIdentifier()
|
|
| Method Summary | |
|---|---|
GrammarType |
getSupportedType()
Returns the supported media type. |
GrammarType |
identify(GrammarDocument grammar)
Identifies the grammar specified by grammar.
These are the rules for a valid ABDF Header:
The ABNF self-identifying header must be present in any
legal stand-alone ABNF Form grammar document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SrgsAbnfGrammarIdentifier()
| Method Detail |
|---|
public GrammarType identify(GrammarDocument grammar)
grammar. If
grammar could be identified a type is returned, otherwise
null.
These are the rules for a valid ABDF Header:
The ABNF self-identifying header must be present in any legal stand-alone ABNF Form grammar document.
The first character of an ABNF document must be the "#" symbol (x23) unless preceded by an optional XML 1.0 byte order mark [XML Paragraph 4.3.3]. The ABNF byte order mark follows the XML definition and requirements. For example, documents encoded in UTF-16 must begin with the byte order mark.
The optional byte order mark and required "#" symbol must be followed immediately by the exact string "ABNF" (x41 x42 x4d x46) or the appropriate equivalent for the document's encoding (e.g. for UTF-16 little-endian: x23 x00 x41 x00 x42 x00 x4d x00 x46 x00). If the byte order mark is absent on a grammar encoded in UTF-16 then the grammar processor should perform auto-detection of character encoding in a manner analogous to auto-detection of character encoding in XML [XML Appendix F].
Next follows a single space character (x20) and the required version number which is "1.0" for this specification (x31 x2e x30).
Next follows an optional character encoding. Section 4.4 defines character encodings in more detail. If present, there must be a single space character (x20) between the version number and the character encoding.
The self-identifying header is finalized with a semicolon (x3b) followed immediately by a newline. The semicolon must be the first character following the version number or the character encoding if is present.
identify in interface GrammarIdentifiergrammar - The grammar to be identified.
public GrammarType getSupportedType()
getSupportedType in interface GrammarIdentifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||