org.jvoicexml.interpreter.grammar.transformer
Class SrgsAbnfGrammarTransformer

java.lang.Object
  extended by org.jvoicexml.interpreter.grammar.transformer.SrgsAbnfGrammarTransformer
All Implemented Interfaces:
GrammarTransformer

public final class SrgsAbnfGrammarTransformer
extends Object
implements GrammarTransformer

This class implements the GrammarTransformer interface. An instance of this class is able to transform a SRGS grammar with ABNF format into RuleGrammar instance. The mime type of the accepted grammar is application/srgs.

Version:
$Revision: 213 $

Copyright © 2005 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Christoph Buente, Dirk Schnelle
See Also:
GrammarTransformer

Constructor Summary
SrgsAbnfGrammarTransformer()
          Standard constructor to instantiate as much GrammarHandler as you need.
 
Method Summary
 GrammarImplementation<? extends Object> createGrammar(UserInput input, GrammarDocument grammar, GrammarType type)
          Creates a JSGF compatible grammar object, which can be passed to the ASR engine.
 GrammarType getSourceType()
          Returns the supported source media type.
 GrammarType getTargetType()
          Returns the supported result media type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrgsAbnfGrammarTransformer

public SrgsAbnfGrammarTransformer()
Standard constructor to instantiate as much GrammarHandler as you need.

Method Detail

getSourceType

public GrammarType getSourceType()
Returns the supported source media type.

Specified by:
getSourceType in interface GrammarTransformer
Returns:
the supported source media type.

getTargetType

public GrammarType getTargetType()
Returns the supported result media type.

Specified by:
getTargetType in interface GrammarTransformer
Returns:
the supported result media type.

createGrammar

public GrammarImplementation<? extends Object> createGrammar(UserInput input,
                                                             GrammarDocument grammar,
                                                             GrammarType type)
                                                      throws NoresourceError,
                                                             UnsupportedFormatError
Creates a JSGF compatible grammar object, which can be passed to the ASR engine.

Specified by:
createGrammar in interface GrammarTransformer
Parameters:
input - The current UserInput to create an empty grammar.
grammar - The grammar document to transform.
type - The target type of the grammar.
Returns:
The result of the transformation. A grammar representation which can be passed to an ASR engine.
Throws:
NoresourceError - Error creating a grammar from the input device.
UnsupportedFormatError - If an unsupported grammar has been given.


Copyright © 2005-2007 JVoiceXML group.