org.jvoicexml.interpreter.grammar
Interface GrammarTransformer

All Known Implementing Classes:
JsgfGrammarTransformer, SrgsAbnfGrammarTransformer, SrgsXmlGrammarTransformer

public interface GrammarTransformer

The GrammarHandler interface defines a couple of methods to process a grammar document from a source type into a target type.

Every implementation of this interface has a GrammarHandlerModeDesc which describes the way a certain input GrammarDocument is processed and converted to a GrammarImplementation.

Version:
$Revision: 213 $

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

Author:
Christoph Buente, Dirk Schnelle

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.
 

Method Detail

createGrammar

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

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.
BadFetchError - If the document could not be fetched successfully.

getSourceType

GrammarType getSourceType()
Returns the supported source media type.

Returns:
the supported source media type.
Since:
0.5.5

getTargetType

GrammarType getTargetType()
Returns the supported result media type.

Returns:
the supported result media type.


Copyright © 2005-2007 JVoiceXML group.