edu.cmu.sphinx.util
Class ResultAnalyzer

java.lang.Object
  extended byedu.cmu.sphinx.util.ResultAnalyzer

public class ResultAnalyzer
extends java.lang.Object

Compares a reference result strings to actual result strings and keeps track of statistics with regard to the strings


Constructor Summary
ResultAnalyzer(boolean verbose)
          Creates a result analyzer
 
Method Summary
 boolean analyze(java.lang.String ref, java.lang.String hyp)
          Compare the hypothesis to the reference string collecting statistics on it.
 java.lang.String getHypothesis()
          Returns the list of hypothesized words only to a space separated string.
 float getSentenceAccuracy()
          Returns the sentence accuracy
 float getWordAccuracy()
          Returns the accuracy
static void main(java.lang.String[] args)
          Quick and dirty test program
 void reset()
          Resets all the accuracy and error statistics.
 void showMisrecognitions()
          Shows the misrecognized utterances.
 void showResults()
          Shows the results for this analyzer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultAnalyzer

public ResultAnalyzer(boolean verbose)
Creates a result analyzer

Parameters:
verbose - if true output comparisons as they are made
Method Detail

analyze

public boolean analyze(java.lang.String ref,
                       java.lang.String hyp)
Compare the hypothesis to the reference string collecting statistics on it. If verbose was set to true, statistics of the match sent to stdout.

Parameters:
ref - the reference string
hyp - the hypothesis string
Returns:
true if the reference and hypothesis match

getWordAccuracy

public float getWordAccuracy()
Returns the accuracy

Returns:
the accuracy between 0.0 and 1.0

getSentenceAccuracy

public float getSentenceAccuracy()
Returns the sentence accuracy

Returns:
the accuracy between 0.0 and 1.0

getHypothesis

public java.lang.String getHypothesis()
Returns the list of hypothesized words only to a space separated string.


reset

public void reset()
Resets all the accuracy and error statistics.


showMisrecognitions

public void showMisrecognitions()
Shows the misrecognized utterances.


showResults

public void showResults()
Shows the results for this analyzer


main

public static void main(java.lang.String[] args)
Quick and dirty test program

Parameters:
args - the commandline arguments