Class AnnotatorTester
java.lang.Object
org.apache.uima.test.junit_extension.AnnotatorTester
Deprecated.
To be removed without replacement.
AnnotatorTester is the helper class to test annotators.
- To be removed in version:
- 4.0.0
-
Constructor Summary
ConstructorDescriptionAnnotatorTester
(File descFile) Deprecated.Constructor save the specified descriptor file path and initialize the analysis engine.AnnotatorTester
(String descFilePath) Deprecated.Constructor save the specified descriptor file path and initialize the analysis engine.AnnotatorTester
(String descFilePath, ResourceManager mgr) Deprecated.Constructor save the specified descriptor file path and initialize the analysis engine. -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeDelegateParameterSetting
(String delegeteKey, String groupName, String paramName, Object paramValue) Deprecated.change the parameter name for the given delegate analysis engine key.void
changeParameterSetting
(String groupName, String paramName, Object paramValue) Deprecated.change the parameter name for the given analysis engine.static void
checkResult
(CAS cas, String[] AnnotationTypes, File refFile, File testFile) Deprecated.checkResult compares the analyzed document with the reference output.Deprecated.Creates a new fresh CAS instance which can be used for testing.static AnalysisEngine
doConfigurationTest
(String configDescFilePath) Deprecated.does configuration parameter test.static CAS
getCASfromXCAS
(File tsFile, File xcasFile) Deprecated.create a CAS object from the given XCAS and typesystem files.performTest
(String text, String language) Deprecated.performs a test on the initialized annotator.static CAS
performTest
(String descFilePath, String text, String language) Deprecated.performs a test with a special annotator configuration.performTest
(CAS cas) Deprecated.performs a test on the initialized annotator.static String
readFileContent
(File file, String encoding) Deprecated.Reads the content form a file to a String with respect to the file encoding.
-
Constructor Details
-
AnnotatorTester
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
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
Deprecated.Constructor save the specified descriptor file path and initialize the analysis engine.- Parameters:
descFilePath
- descriptor file pathmgr
- 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 nullparamName
- parameter nameparamValue
- 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 keygroupName
- group nameparamName
- parameter nameparamValue
- parameter value- Throws:
InvalidXMLException
- passthruResourceInitializationException
- passthruIOException
- passthru
-
doConfigurationTest
Deprecated.does configuration parameter test.- Parameters:
configDescFilePath
- the config desc file path- Returns:
- AnalysisEngine
- Throws:
Exception
- passthru
-
createCAS
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
Deprecated.performs a test on the initialized annotator. The specified document is processed with the given language.- Parameters:
text
- a document textlanguage
- the document text language- Returns:
- CAS - results of the analysis
- Throws:
Exception
- passthru
-
performTest
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
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 pathtext
- a document textlanguage
- the document text language- Returns:
- CAS - results of the analysis
- Throws:
Exception
- passthru
-
getCASfromXCAS
Deprecated.create a CAS object from the given XCAS and typesystem files.- Parameters:
tsFile
- - a typesystem filexcasFile
- - a xcas file- Returns:
- CAS - CAS object created from the given input data
- Throws:
Exception
- passthru
-
readFileContent
Deprecated.Reads the content form a file to a String with respect to the file encoding.- Parameters:
file
- a file with the sourceencoding
- 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 dataAnnotationTypes
- respected annotation typesrefFile
- reference outputtestFile
- test file for the current output- Throws:
Exception
- passthru
-