uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Cwiklik <uim...@gmail.com>
Subject Re: Programmatically create a CPE
Date Mon, 08 Jun 2009 18:47:58 GMT
Fabio Mancinelli <fabio.mancinelli@...> writes:

> 
> Hi everybody,
> 
> I was wondering how I could assemble a CPE from a Java program without
> using an XML descriptor.
> 
> The idea was to create analysis engines, collection readers and cas
> consumers and to assemble them programmatically in a CPE using Java
> code.
> 
> UIMAFramework.produceCollectionProcessingEngine() requires a
> CpeDescription object that apparently can be built only from an XML
> file (whose creation is not even supported by the Eclipse UIMA plugin
> and, afaiu, it must be created exclusively by using the cpeGui.sh
> program).
> 
> Any hint?
> 
> Thanks,
> Fabio
> 
> 
Fabio, there is a way to create a CpeDescriptor in your java program.
Use the following:

CpeDescription cd = CpeDescriptorFactory.produceDescriptor();

With the above you get a descriptor with default values. Use the API to change
the descriptor as needed.

Once you have the descriptor configured, you than call:

mCPE = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);


Regards, Jerry C





Mime
View raw message