Class AnnotatorTester

java.lang.Object
org.apache.uima.test.junit_extension.AnnotatorTester

@Deprecated public class AnnotatorTester extends Object
Deprecated.
To be removed without replacement.
AnnotatorTester is the helper class to test annotators.
To be removed in version:
4.0.0
  • Constructor Details

    • AnnotatorTester

      public AnnotatorTester(String descFilePath) throws Exception
      Deprecated.
      Constructor save the specified descriptor file path and initialize the analysis engine.
      Parameters:
      descFilePath - descriptor file path
      Throws:
      Exception - passthru if an analysis engine initialize error occurs.
    • AnnotatorTester

      public AnnotatorTester(File descFile) throws Exception
      Deprecated.
      Constructor save the specified descriptor file path and initialize the analysis engine.
      Parameters:
      descFile - descriptor file
      Throws:
      Exception - passthru if an analysis engine initialize error occurs.
    • AnnotatorTester

      public AnnotatorTester(String descFilePath, ResourceManager mgr) throws Exception
      Deprecated.
      Constructor save the specified descriptor file path and initialize the analysis engine.
      Parameters:
      descFilePath - descriptor file path
      mgr - a ResourceManager
      Throws:
      Exception - if an analysis engine initialize error occurs.
  • Method Details

    • changeParameterSetting

      public void changeParameterSetting(String groupName, String paramName, Object paramValue) throws ResourceConfigurationException
      Deprecated.
      change the parameter name for the given analysis engine.
      Parameters:
      groupName - group name, if no group is available, pass null
      paramName - parameter name
      paramValue - parameter value
      Throws:
      ResourceConfigurationException - passthru
    • changeDelegateParameterSetting

      public void changeDelegateParameterSetting(String delegeteKey, String groupName, String paramName, Object paramValue) throws InvalidXMLException, ResourceInitializationException, IOException
      Deprecated.
      change the parameter name for the given delegate analysis engine key.
      Parameters:
      delegeteKey - analysis engine key
      groupName - group name
      paramName - parameter name
      paramValue - parameter value
      Throws:
      InvalidXMLException - passthru
      ResourceInitializationException - passthru
      IOException - passthru
    • doConfigurationTest

      public static AnalysisEngine doConfigurationTest(String configDescFilePath) throws Exception
      Deprecated.
      does configuration parameter test.
      Parameters:
      configDescFilePath - the config desc file path
      Returns:
      AnalysisEngine
      Throws:
      Exception - passthru
    • createCAS

      public CAS createCAS() throws Exception
      Deprecated.
      Creates a new fresh CAS instance which can be used for testing.
      Returns:
      a new fresh CAS instance which can be used for testing
      Throws:
      Exception - passthru
    • performTest

      public CAS performTest(String text, String language) throws Exception
      Deprecated.
      performs a test on the initialized annotator. The specified document is processed with the given language.
      Parameters:
      text - a document text
      language - the document text language
      Returns:
      CAS - results of the analysis
      Throws:
      Exception - passthru
    • performTest

      public CAS performTest(CAS cas) throws Exception
      Deprecated.
      performs a test on the initialized annotator. The specified CAS is processed and the results are returned.
      Parameters:
      cas - a CAS for processing
      Returns:
      CAS - results of the analysis
      Throws:
      Exception - passthru
    • performTest

      public static CAS performTest(String descFilePath, String text, String language) throws Exception
      Deprecated.
      performs a test with a special annotator configuration. For this a new AE is created and used to process the specified document for the specified language.
      Parameters:
      descFilePath - Descriptor file path
      text - a document text
      language - the document text language
      Returns:
      CAS - results of the analysis
      Throws:
      Exception - passthru
    • getCASfromXCAS

      public static CAS getCASfromXCAS(File tsFile, File xcasFile) throws Exception
      Deprecated.
      create a CAS object from the given XCAS and typesystem files.
      Parameters:
      tsFile - - a typesystem file
      xcasFile - - a xcas file
      Returns:
      CAS - CAS object created from the given input data
      Throws:
      Exception - passthru
    • readFileContent

      public static String readFileContent(File file, String encoding) throws Exception
      Deprecated.
      Reads the content form a file to a String with respect to the file encoding.
      Parameters:
      file - a file with the source
      encoding - file encoding
      Returns:
      String - file content
      Throws:
      Exception - passthru
    • checkResult

      public static void checkResult(CAS cas, String[] AnnotationTypes, File refFile, File testFile) throws Exception
      Deprecated.
      checkResult compares the analyzed document with the reference output.
      Parameters:
      cas - a cas with the analyzed data
      AnnotationTypes - respected annotation types
      refFile - reference output
      testFile - test file for the current output
      Throws:
      Exception - passthru