You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Fabio Mancinelli <fa...@gmail.com> on 2009/06/08 15:50:09 UTC
Programmatically create a CPE
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
Re: Programmatically create a CPE
Posted by Fabio Mancinelli <fa...@gmail.com>.
On Tue, Jun 9, 2009 at 9:48 AM, Kai Schlamp<sc...@gmx.de> wrote:
> Hi Fabio.
>
> It's in the documentation (it also has nearly the same heading as your
> subject):
> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.application.configuring_a_cpe_descriptor_programmatically
>
Thanks Kai and Jerry.
Got it.
Cheers,
Fabio
Re: Programmatically create a CPE
Posted by Kai Schlamp <sc...@gmx.de>.
Hi Fabio.
It's in the documentation (it also has nearly the same heading as your subject):
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.application.configuring_a_cpe_descriptor_programmatically
Kai
Fabio Mancinelli wrote:
> 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
>
Re: Programmatically create a CPE
Posted by Jerry Cwiklik <ui...@gmail.com>.
Fabio Mancinelli <fa...@...> 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