org.jvoicexml.implementation
Interface GrammarImplementation<T>

Type Parameters:
T - the grammar implementation.
All Known Implementing Classes:
DocumentGrammarImplementation, NuanceDynagramBinaryGrammarImplementation, SrgsXmlGrammarImplementation

public interface GrammarImplementation<T>

Implementation of a grammar that is accessed by the VoiceXML interpreter and passed to the ImplementationPlatform if the grammar is activated or deactivated.

VoiceXML is designed to support at least

Custom implementations must implement this interface to hook their own grammar specification.

Since:
0.5.5
Version:
$Revision: 2632 $
Author:
Dirk Schnelle-Walka

Method Summary
 boolean accepts(RecognitionResult result)
          Checks, if this grammar covers the given recognition result.
 boolean equals(GrammarImplementation<T> other)
          Checks if this grammar implementation is equal to the given grammar implementation.
 T getGrammar()
          Retrieves the grammar object.
 GrammarType getMediaType()
          Returns the declared media type of the external grammar.
 ModeType getModeType()
          Returns the mode type of the grammar.
 

Method Detail

getMediaType

GrammarType getMediaType()
Returns the declared media type of the external grammar.

Returns:
The media type of the grammar file.

getModeType

ModeType getModeType()
Returns the mode type of the grammar.

Returns:
mode type of the grammar.
Since:
0.7

getGrammar

T getGrammar()
Retrieves the grammar object.

Returns:
the grammar.

accepts

boolean accepts(RecognitionResult result)
Checks, if this grammar covers the given recognition result.

It is not legal to check if the result is accepted using RecognitionResult.isAccepted(). Implementations should assume that it is a valid input result.

Implementations can use the GrammarChecker.

Parameters:
result - the result to check.
Returns:
true if the utterance is valid for this grammar
Since:
0.7

equals

boolean equals(GrammarImplementation<T> other)
Checks if this grammar implementation is equal to the given grammar implementation.

Parameters:
other - the grammar implementation to compare with.
Returns:
true if the grammar implementations are equal.
Since:
0.7.2


Copyright © 2005-2010JVoiceXML group.