JSR-043: JTAPI-1.4

javax.telephony.media
Interface ASREvent.TokenSequence

Enclosing class:
ASREvent

public static interface ASREvent.TokenSequence

Defines the methods for retrieving a single sequence of Tokens.

For TypeI results, each TokenSequence holds one row of result Tokens. For TypeII results, each TokenSequence is one potential interpretation of the utterance.

Each TokenSequence consists of several attributes, plus a sequence of Token Strings, and parallel sequences of TokenQualifiers and TokenScores.

Note: Some of these values are 'optional', and may not be supplied in the ASREvent. If not supplied, the return value is null, or for return values of type int the value will be -1.

See Also:
ASREvent.getTokenSequence

Method Summary
 java.lang.String getContextName()
          Get the context from which the sequence is taken.
 java.lang.String getGrammarTag(int j)
          Get the GrammarTag for the jth token in this sequence.
 Symbol getLanguage()
          Get the language of the sequence.
 Symbol getLanguageVariant()
          Get the language variant of the sequence.
 int getSequenceLength()
          Get the number of tokens in this result sequence.
 Symbol getSequenceQualifier()
          Get an overall qualifier of the sequence.
 int getSequenceScore()
          Get the recognizer's confidence in the sequence of tokens.
 java.lang.String getSequenceSpeaker()
          Get the name of the speaker of the sequence.
 java.lang.String getToken(int j)
          Get the name of the jth token in this sequence.
 Symbol getTokenQualifier(int j)
          Get the qualifier for the jth token in this sequence.
 int getTokenScore(int j)
          Get the the recognizer's confidence for the jth token.
 

Method Detail

getSequenceLength

public int getSequenceLength()
Get the number of tokens in this result sequence.
Returns:
the int number of tokens in this sequence.

getToken

public java.lang.String getToken(int j)
Get the name of the jth token in this sequence.
Parameters:
j - index of the token to be returned.
Returns:
the name String that identifies the jth token.
See Also:
ASR.wordCommit(java.lang.String, java.lang.String, java.lang.String)

getTokenQualifier

public Symbol getTokenQualifier(int j)
Get the qualifier for the jth token in this sequence. The returned Symbol indicates whether the jth token is to be interpreted as garbage, silence, an actual token, or a grammar tag.

Possible values are ASRConstants.v_Normal, ASRConstants.v_Garbage, and ASRConstants.v_Silence. For Type II results, the value may also be ASRConstants.v_GrammarTag.

Parameters:
j - index of the token to be returned.
Returns:
the Qualifier Symbol for the jth token.

getGrammarTag

public java.lang.String getGrammarTag(int j)
Get the GrammarTag for the jth token in this sequence. [optional]

When getToken(j) is null, one should check getTokenQualifier(j) to see if there is a valid grammerTag in getGrammerTag(j). Note: This can probably be folded into getToken because the TokenQualifier indicates whether the jth element is a GrammarTag .

Parameters:
j - index of the token for which the GrammarTag is returned.
Returns:
the GrammarTag String for the jth token.

getTokenScore

public int getTokenScore(int j)
Get the the recognizer's confidence for the jth token. [optional]

Note: getTokenScore(0) should return -1 iff getTokenScore(i: i < sequenceLength) returns -1. An application should not need to check each value for validity.

Parameters:
j - index of the token for which the confidence is returned.
Returns:
an int in the range 0 to 1000, or -1 if TokenScores are not provided.

getContextName

public java.lang.String getContextName()
Get the context from which the sequence is taken.
Returns:
String containing the name of the context.

getLanguage

public Symbol getLanguage()
Get the language of the sequence. [optional]
Returns:
Symbol containing the language of the sequence.

getLanguageVariant

public Symbol getLanguageVariant()
Get the language variant of the sequence. [optional]
Returns:
Symbol containing the language variant.

getSequenceSpeaker

public java.lang.String getSequenceSpeaker()
Get the name of the speaker of the sequence.
Returns:
String containing the name of the speaker.

getSequenceQualifier

public Symbol getSequenceQualifier()
Get an overall qualifier of the sequence.
Returns:
Symbol containing one of ASRConstants.v_Normal, ASRConstants.v_Garbage, and ASRConstants.v_Silence.

getSequenceScore

public int getSequenceScore()
Get the recognizer's confidence in the sequence of tokens. [optional]
Returns:
int value in the range 0 to 1000, or -1 if SequenceScore is not provided.

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org