org.apache.taglibs.rdc.core
Class NBestResults

java.lang.Object
  extended by org.apache.taglibs.rdc.core.NBestResults
All Implemented Interfaces:
java.io.Serializable

public class NBestResults
extends java.lang.Object
implements java.io.Serializable

Deserializes and stores n-best data received from the vxml browser.

Author:
Sreeram Balakrishnan, Rahul Akolkar
See Also:
Serialized Form

Constructor Summary
NBestResults()
           
 
Method Summary
 float getNthConfidence(int n)
          Get confidence for Nth result
 java.util.Map getNthInterpretation(int n)
          Get interpretation for Nth result, which is stored as a HashMap of attribute-value pairs
 java.lang.String getNthUtterance(int n)
          Get utterance for Nth result
 int getNumNBest()
          Get the number of results stored
 void setNBestResults(java.lang.String serializedNBest)
          Populate this object with the n-best results corresponding to this serialized string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NBestResults

public NBestResults()
Method Detail

getNumNBest

public int getNumNBest()
Get the number of results stored

Returns:
int the number of results stored

getNthConfidence

public float getNthConfidence(int n)
Get confidence for Nth result

Parameters:
n - the index of the result
Returns:
the float value of the confidence

getNthInterpretation

public java.util.Map getNthInterpretation(int n)
Get interpretation for Nth result, which is stored as a HashMap of attribute-value pairs

Parameters:
n - the index of the result
Returns:
the interpretation

getNthUtterance

public java.lang.String getNthUtterance(int n)
Get utterance for Nth result

Parameters:
n - the index of the result
Returns:
the utterance

setNBestResults

public void setNBestResults(java.lang.String serializedNBest)
Populate this object with the n-best results corresponding to this serialized string

Parameters:
serializedNBest - the serialized n-best result string obtained from the vxml browser To understand this method, look at the nbest.js file in the .grammar directory


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.