uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Fette <georg.fe...@uni-wuerzburg.de>
Subject UIMA ResultSpecification
Date Sat, 13 Apr 2013 12:49:40 GMT
Hello,
I have a problem in understanding how to use the class 
"ResultSpecification". I thought that before I call "process(cas)" I 
configure an instance of ResultSpecification by adding types which have 
to be produced in the process call. My test code looks like this:

MainClass:
------------------
AnalysisEngineDescription aed = 
AnalysisEngineFactory.createPrimitiveDescription(TestEngine.class);
AnalysisEngine ae = AnalysisEngineFactory.createPrimitive(aed);
ResultSpecification resultSpec = 
UIMAFramework.getResourceSpecifierFactory().createResultSpecification();
resultSpec.addResultType("test", true);
CAS cas = CasCreationUtils.createCas(aed);
ae.process(cas, resultSpec);

TestEngine:
-------------------------
     @Override
     public void process(JCas arg0) throws AnalysisEngineProcessException {
         ResultSpecification resultSpec = getResultSpecification();
         TypeOrFeature[] types = resultSpec.getResultTypesAndFeatures();
     }

Unfortunately the types-array in is retured by the resultSpec in the 
enginge's process method is always empty.
What am I doing wrong ?
Greetings
Georg

Mime
View raw message