de.dfleischhacker.uni.thesis.userinterface.textbased
Class ResultAggregator

java.lang.Object
  extended by de.dfleischhacker.uni.thesis.userinterface.textbased.ResultAggregator

public class ResultAggregator
extends java.lang.Object

This class is used to log the results of calculations and provides methods to export the data to a file. Results are logged per test subject and testcase, a logged result consists, amongst others, of precision and recall.


Nested Class Summary
 class ResultAggregator.ErrorMessage
          Subclass of Result representing an error and containing the appropriate error message
 class ResultAggregator.Result
          Internal class representing a result consisting of testcase name and precision and recall values.
 
Constructor Summary
ResultAggregator(java.lang.String basedir, java.lang.String semanticName)
          Initializes an empty ResultsAggregator
 
Method Summary
 void addError(java.lang.String subject, java.lang.String testcase, java.lang.String errorMessage)
          Logs an error occuring during calculation.
 void addResult(java.lang.String subject, java.lang.String testcase, float precision, float recall, int evaluationAlignmentSize, int referenceAlignmentSize, int evaluationClosureSize, int referenceClosureSize, int intersectionSize)
          Adds the given results for a specific subject and testcase combination into the result log.
 ResultAggregator.Result getResult(java.lang.String subject, java.lang.String testcase)
          Returns the result for the given subject/testcase combination.
 void writeXML(java.lang.String filename)
          Writes the results aggregated by this ResultAggregator into the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultAggregator

public ResultAggregator(java.lang.String basedir,
                        java.lang.String semanticName)
Initializes an empty ResultsAggregator

Parameters:
basedir - directory serving as base for batchstarter
semanticName - name of semantic used for evaluation
Method Detail

addResult

public void addResult(java.lang.String subject,
                      java.lang.String testcase,
                      float precision,
                      float recall,
                      int evaluationAlignmentSize,
                      int referenceAlignmentSize,
                      int evaluationClosureSize,
                      int referenceClosureSize,
                      int intersectionSize)
Adds the given results for a specific subject and testcase combination into the result log.

Parameters:
subject - string identifying the subject
testcase - string identifying the specific testcase
precision - precision result
recall - recall result

addError

public void addError(java.lang.String subject,
                     java.lang.String testcase,
                     java.lang.String errorMessage)
Logs an error occuring during calculation.

Parameters:
subject - subject the error occurs for
testcase - testcase the error occurs for
errorMessage - message describing the error

getResult

public ResultAggregator.Result getResult(java.lang.String subject,
                                         java.lang.String testcase)
Returns the result for the given subject/testcase combination.

Parameters:
subject - subject to get result for
testcase - string identifying the testcase to get result for
Returns:
Result object containing the logged values, null if subject/testcase combination invalid

writeXML

public void writeXML(java.lang.String filename)
              throws javax.xml.parsers.ParserConfigurationException,
                     javax.xml.transform.TransformerConfigurationException,
                     javax.xml.transform.TransformerException
Writes the results aggregated by this ResultAggregator into the given file. A simple XML file format is used for this purpose which allows easy processing by the user.

Parameters:
filename - filename to write the aggreated results to
Throws:
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException