|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.NISTAlign
Implements a portion of the NIST align/scoring algorithm to compare a reference string to a hypothesis string. It only keeps track of substitutions, insertions, and deletions.
Constructor Summary | |
NISTAlign(boolean showResults,
boolean showAlignedResults)
Creates a new NISTAlign object. |
Method Summary | |
boolean |
align(java.lang.String reference,
java.lang.String hypothesis)
Performs the NIST alignment on the reference and hypothesis strings. |
java.lang.String |
getAlignedHypothesis()
Returns the aligned hypothesis string. |
java.lang.String |
getAlignedReference()
Returns the aligned reference string. |
java.lang.String |
getHypothesis()
Returns the hypothesis string. |
java.lang.String |
getReference()
Returns the reference string. |
int |
getTotalDeletions()
Gets the total number of deletions |
int |
getTotalInsertions()
Gets the total number of insertion errors |
float |
getTotalSentenceAccuracy()
Returns the total sentence accuracy. |
int |
getTotalSentences()
Gets the total number of sentences |
int |
getTotalSentencesWithErrors()
Gets the total number of sentences with errors |
int |
getTotalSubstitutions()
Gets the total number of substitution errors |
float |
getTotalWordAccuracy()
Returns the total word accuracy. |
float |
getTotalWordErrorRate()
Returns the total word accuracy. |
int |
getTotalWordErrors()
Gets the total number of word errors for all calls to align. |
int |
getTotalWords()
Gets the total number of words |
static void |
main(java.lang.String[] args)
Take two filenames -- the first contains a list of reference sentences, the second contains a list of hypothesis sentences. |
void |
printNISTSentenceSummary()
Prints the results for this sentence to System.out. |
void |
printNISTTotalSummary()
Prints the summary for all calls to align to System.out. |
void |
printSentenceSummary()
Prints the results for this sentence to System.out. |
void |
printTotalSummary()
Prints the total summary for all calls. |
void |
resetTotals()
Reset the total insertions, deletions, and substitutions counts for this class. |
void |
setShowAlignedResults(boolean showAlignedResults)
Sets whether aligned results are displayed |
void |
setShowResults(boolean showResults)
Sets whether results are displayed |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NISTAlign(boolean showResults, boolean showAlignedResults)
Method Detail |
public void setShowResults(boolean showResults)
showResults
- true if the results should be
displayedpublic void setShowAlignedResults(boolean showAlignedResults)
showAlignedResults
- true if the aligned results should be
displayedpublic void resetTotals()
public boolean align(java.lang.String reference, java.lang.String hypothesis)
reference
- the reference stringhypothesis
- the hypothesis string
public java.lang.String getReference()
public java.lang.String getHypothesis()
public java.lang.String getAlignedReference()
public java.lang.String getAlignedHypothesis()
public int getTotalWordErrors()
public float getTotalWordAccuracy()
public float getTotalWordErrorRate()
public float getTotalSentenceAccuracy()
public int getTotalWords()
public int getTotalSubstitutions()
public int getTotalInsertions()
public int getTotalDeletions()
public int getTotalSentences()
public int getTotalSentencesWithErrors()
public void printSentenceSummary()
printNISTSentenceSummary()
public void printTotalSummary()
printNISTTotalSummary()
public void printNISTSentenceSummary()
public void printNISTTotalSummary()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |