|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.uima.test.junit_extension.AnnotatorTester
public class AnnotatorTester
AnnotatorTester is the helper class to test annotators.
| Constructor Summary | |
|---|---|
AnnotatorTester(java.io.File descFile)
Constructor save the specified descriptor file path and initialize the analysis engine. |
|
AnnotatorTester(java.lang.String descFilePath)
Constructor save the specified descriptor file path and initialize the analysis engine. |
|
AnnotatorTester(java.lang.String descFilePath,
ResourceManager mgr)
Constructor save the specified descriptor file path and initialize the analysis engine. |
|
| Method Summary | |
|---|---|
void |
changeDelegateParameterSetting(java.lang.String delegeteKey,
java.lang.String groupName,
java.lang.String paramName,
java.lang.Object paramValue)
change the parameter name for the given delegate analysis engine key |
void |
changeParameterSetting(java.lang.String groupName,
java.lang.String paramName,
java.lang.Object paramValue)
change the parameter name for the given analysis engine |
static void |
checkResult(CAS cas,
java.lang.String[] AnnotationTypes,
java.io.File refFile,
java.io.File testFile)
checkResult compares the analyzed document with the reference output. |
static AnalysisEngine |
doConfigurationTest(java.lang.String configDescFilePath)
does configuration parameter test |
static CAS |
getCASfromXCAS(java.io.File tsFile,
java.io.File xcasFile)
create a CAS object from the given XCAS and typesystem files |
CAS |
performTest(CAS cas)
performs a test on the initialized annotator. |
CAS |
performTest(java.lang.String text,
java.lang.String language)
performs a test on the initialized annotator. |
static CAS |
performTest(java.lang.String descFilePath,
java.lang.String text,
java.lang.String language)
performs a test with a special annotator configuration. |
static java.lang.String |
readFileContent(java.io.File file,
java.lang.String encoding)
Reads the content form a file to a String with respect to the file encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotatorTester(java.lang.String descFilePath)
throws java.lang.Exception
descFilePath - descriptor file path
java.lang.Exception - if an analysis engine initialize error occurs.
public AnnotatorTester(java.io.File descFile)
throws java.lang.Exception
descFile - descriptor file
java.lang.Exception - if an analysis engine initialize error occurs.
public AnnotatorTester(java.lang.String descFilePath,
ResourceManager mgr)
throws java.lang.Exception
descFilePath - descriptor file pathmgr - a ResourceManager
java.lang.Exception - if an analysis engine initialize error occurs.| Method Detail |
|---|
public void changeParameterSetting(java.lang.String groupName,
java.lang.String paramName,
java.lang.Object paramValue)
throws ResourceConfigurationException
groupName - group name, if no group is available, pass nullparamName - parameter nameparamValue - parameter value
ResourceConfigurationException
public void changeDelegateParameterSetting(java.lang.String delegeteKey,
java.lang.String groupName,
java.lang.String paramName,
java.lang.Object paramValue)
throws InvalidXMLException,
ResourceInitializationException,
java.io.IOException
delegeteKey - analysis engine keygroupName - group nameparamName - parameter nameparamValue - parameter value
InvalidXMLException
ResourceInitializationException
java.io.IOException
public static AnalysisEngine doConfigurationTest(java.lang.String configDescFilePath)
throws java.lang.Exception
configDescFilePath -
java.lang.Exception
public CAS performTest(java.lang.String text,
java.lang.String language)
throws java.lang.Exception
text - a document textlanguage - the document text language
java.lang.Exception
public CAS performTest(CAS cas)
throws java.lang.Exception
cas - a CAS for processing
java.lang.Exception
public static CAS performTest(java.lang.String descFilePath,
java.lang.String text,
java.lang.String language)
throws java.lang.Exception
descFilePath - Descriptor file pathtext - a document textlanguage - the document text language
java.lang.Exception
public static CAS getCASfromXCAS(java.io.File tsFile,
java.io.File xcasFile)
throws java.lang.Exception
tsFile - -
a typesystem filexcasFile - -
a xcas file
java.lang.Exception
public static java.lang.String readFileContent(java.io.File file,
java.lang.String encoding)
throws java.lang.Exception
file - a file with the sourceencoding - file encoding
java.lang.Exception
public static void checkResult(CAS cas,
java.lang.String[] AnnotationTypes,
java.io.File refFile,
java.io.File testFile)
throws java.lang.Exception
cas - a cas with the analyzed dataAnnotationTypes - respected annotation typesrefFile - reference outputtestFile - test file for the current output
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||