uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Armin.Weg...@bka.bund.de>
Subject AW: Getting the effective type system
Date Tue, 30 Apr 2013 08:39:57 GMT
Hello Richard,

using your second suggestion, I've written a very simple CAS consumer like the one in [2].
It's a one-liner and works fine:

public final void process(final CAS cas) throws AnalysisEngineProcessException {
	try {
		TypeSystemUtil.typeSystem2TypeSystemDescription(cas.getTypeSystem()).toXML(new FileOutputStream(new
	} catch ...

The other approach doesn't work because desc.getAnalysisEngineMetaData().getTypeSystem() is


-----Urspr√ľngliche Nachricht-----
Von: Richard Eckart de Castilho [mailto:richard.eckart@gmail.com] 
Gesendet: Montag, 29. April 2013 18:36
An: user@uima.apache.org
Betreff: Re: Getting the effective type system


if you use the automatic type system detection feature of uimaFIT [1], you can get the full
automatically detected type system by calling TypeSystemDescriptionFactory.createTypeSystemDescription(),
even without an aggregate. 

Or you just create it from the AnalysisEngineDescription you get from the AggregateBuilder.
I have to admit, that I didn't try if that really gets the aggregated type system (after resolving,
see below).

For both approaches, mind to resolve the imports:

AnalysisEngineDescription desc = .
ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();

Finally, you can could create an AnalysisEngine from your aggregate description, create a
CAS from it and use TypeSystemUtil.typeSystem2TypeSystemDescription(aJCas.getTypeSystem()).toXML(typeOS).
This also works in a consumer (cf. DKPro Core XMIWriter [2]).


-- Richard

[1] https://code.google.com/p/uimafit/wiki/TypeDescriptorDetection
[2] https://dkpro-core-asl.googlecode.com/svn/de.tudarmstadt.ukp.dkpro.core-asl/trunk/de.tudarmstadt.ukp.dkpro.core.io.xmi-asl/src/main/java/de/tudarmstadt/ukp/dkpro/core/io/xmi/XmiWriter.java

Am 29.04.2013 um 17:10 schrieb <Armin.Wegner@bka.bund.de>:

> Hi!
> Using org.uimafit.factory.AggregateBuilder you can aggregate analysis engines with different
type systems. Is there any way to serialize the effective type system from such an aggregate
or from the CAS it is using?
> Thanks,
> Armin

View raw message