public class TestUtil extends Object
Constructor and Description |
---|
TestUtil() |
Modifier and Type | Method and Description |
---|---|
static org.apache.uima.analysis_engine.AnalysisEngine |
getAE(File analysisEngineDescriptorFile) |
static org.apache.uima.collection.CollectionReader |
getCR(File collectionReaderDescriptorFile) |
static <T extends org.apache.uima.jcas.cas.TOP> |
getFeatureStructureAtIndex(org.apache.uima.jcas.JCas jCas,
Class<T> cls,
int index) |
static <T extends org.apache.uima.jcas.cas.TOP> |
getFeatureStructureSize(org.apache.uima.jcas.JCas jCas,
Class<T> cls) |
static org.apache.uima.jcas.JCas |
processAE(org.apache.uima.analysis_engine.AnalysisEngine ae,
File textFile)
This method simply calls
#createAnalysisEngineJCas(File, File, String) with the
charSetName equal to "UTF-8". |
static org.apache.uima.jcas.JCas |
processAE(org.apache.uima.analysis_engine.AnalysisEngine ae,
File textFile,
String charSetName)
This method reads in the text from the text file using the provided
character set and then calls
#getJCas(File, String) |
static org.apache.uima.jcas.JCas |
processAE(org.apache.uima.analysis_engine.AnalysisEngine ae,
String text)
This method creates a JCas for the provided analysis engine descriptor
file and then processes the provided text and returns the JCas.
|
static void |
testConfigParam(org.apache.uima.UimaContext uimaContext,
String descriptorFile,
String paramName,
Object paramValue) |
static void |
testConfigParam(org.apache.uima.UimaContext uimaContext,
String descriptorFile,
String paramName,
Object paramValue,
Integer arrayIndex) |
public static org.apache.uima.jcas.JCas processAE(org.apache.uima.analysis_engine.AnalysisEngine ae, File textFile) throws org.apache.uima.resource.ResourceInitializationException
#createAnalysisEngineJCas(File, File, String)
with the
charSetName equal to "UTF-8".analysisEngineDescriptorFile
- a descriptor file for a UIMA Analysis Engine.textFile
- a file that contains text that the analysis engine will
process.org.apache.uima.resource.ResourceInitializationException
#createAnalysisEngineJCas(File, File, String)}
public static org.apache.uima.jcas.JCas processAE(org.apache.uima.analysis_engine.AnalysisEngine ae, File textFile, String charSetName) throws org.apache.uima.resource.ResourceInitializationException
#getJCas(File, String)
analysisEngineDescriptorFile
- a descriptor file for a UIMA Analysis Engine.textFile
- a file that contains text that the analysis engine will
process.charSetName
- the name of the character encoding of the fileorg.apache.uima.resource.ResourceInitializationException
#getJCas(File, String)}
,
Charset
public static org.apache.uima.jcas.JCas processAE(org.apache.uima.analysis_engine.AnalysisEngine ae, String text) throws org.apache.uima.resource.ResourceInitializationException
JCas jCas = createAnalysisEngineJCas(someAEDescriptorFile, someText);
analysisEngineDescriptorFile
- a descriptor file for a UIMA Analysis Engine.text
- text that the analysis engine will process.org.apache.uima.resource.ResourceInitializationException
- The code for this method was found here:
http://article.gmane.org/gmane.comp.apache.uima.general/880/match=push+documents+into+cpe+collectionreaderpublic static org.apache.uima.analysis_engine.AnalysisEngine getAE(File analysisEngineDescriptorFile) throws org.apache.uima.resource.ResourceInitializationException
org.apache.uima.resource.ResourceInitializationException
public static org.apache.uima.collection.CollectionReader getCR(File collectionReaderDescriptorFile) throws org.apache.uima.resource.ResourceInitializationException
org.apache.uima.resource.ResourceInitializationException
public static <T extends org.apache.uima.jcas.cas.TOP> int getFeatureStructureSize(org.apache.uima.jcas.JCas jCas, Class<T> cls)
public static <T extends org.apache.uima.jcas.cas.TOP> T getFeatureStructureAtIndex(org.apache.uima.jcas.JCas jCas, Class<T> cls, int index)
public static void testConfigParam(org.apache.uima.UimaContext uimaContext, String descriptorFile, String paramName, Object paramValue)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.