uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Franchini" <ro.franch...@gmail.com>
Subject Building AggrgateAnalysisEngine programmatically
Date Wed, 14 Nov 2007 12:09:57 GMT
Hi to all,
I need to build an aggregate angine in a programmatic way, but I
didn't find anything in the docs or api.

I'm using a CPM, where i deploy some processors, consumers and a
collection reader.
Now I want to process a single string and try this:
...
			cpm.init(true, new Properties());
AnalysisEngine analysisEngine = this.cpm.getAnalysisEngine();
...
but i got an ArrayIndexOutOfBoundException.

Taking a look at the CPMImpl, i saw this code:

  public AnalysisEngine getAnalysisEngine() {
    if (super.getCasProcessors()[0] != null) {
      try {
        if (super.getCasProcessors()[0] instanceof AnalysisEngine) {
          return (AnalysisEngine) super.getCasProcessors()[0];
        }
      } catch (ClassCastException cE) {
        cE.printStackTrace();
        return null;
      }
    }
    return null;
  }

the AIOBE is on the super.getCasProcessors()[0] statement.

So, at least, I will get the first processor deployed, not a whole
analysys engine composed of all casprocessor :(

I'm thinking to switch to a CPE instead of CPM, but i think it will be the same.

regards,
Roberto

-- 
Roberto Franchini
CELI s.r.l.  (http://www.celi.it) - C.so Moncalieri 21 - 10131 Torino - ITALY
Tel +39-011-6600814 - Fax +39-011-6600687
jabber:ro.franchini@gmail.com skype:ro.franchini

Mime
View raw message