Hello Adei,
unless you need classpath separation (which is a feature of PEARs), I would
suggest you just create instances of your UIMA components in some Spring bean
and run them. I would suggest to try using uimaFIT for this, e.g.:
TypeSystemDescription tsd =
TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath(
"src/test/resources/org/uimafit/type/AnalyzedText.xml");
// Instantiate component
AnalysisEngine ae =
AnalysisEngineFactory.createPrimitive(MyAnalysisEngine.class, tsd);
JCas jcas = ae.newJCas();
jcas.setDocumenText("my text");
// Test that injection works
ae.process(jcas);
for (MyAnnotation a : JCasUtil.select(jcas,
MyAnnotation.class)) {
... do something with your analysis;
}
If you are interested in using UIMA within Spring, you might be interested in
the (experimental) uimafit-spring bridge. It provides
1) a way to inject Spring beans as UIMA external resources into UIMA components
2) a way to run the bean postprocessors of your Spring context on your UIMA
components so that the actual Spring annotations work, e.g. @Resource or
possible @Transactional etc.
http://code.google.com/p/uimafit/source/browse/trunk/uimaFIT-spring/src/test/java/org/uimafit/spring/SpringContextResourceManagerTest.java
http://code.google.com/p/uimafit/source/browse/trunk/uimaFIT-spring/src/test/java/org/uimafit/spring/UimaFactoryInjectionTest.java
Note that if you bind this tightly to your Spring context, you will not be able
to use UIMA's scale-out features. But for small systems or prototypes, its can
be very useful.
Best,
-- Richard
Am 18.11.2011 um 11:15 schrieb Adei Mandaluniz:
> Hi,
>
> I'm quite a newbie using UIMA and my question may be (I'm sure it is) a
> basic question.
>
> Here it go...
>
> I've created my own Annotator, what I want to do is integrate it with
> java-spring based application so I can post some text to the annotator and
> get the annotations back.
> So the question is, how can I integrate it with another application? Do I
> need to package it as something else than PEAR, or do I need to deploy it
> on a server and call it as an external tool, if so, how?
>
> Thanks in advance!
> Adei
>
>
> This message should be regarded as confidential. If you have received this
> email in error please notify the sender and destroy it immediately.
> Statements of intent shall only become binding when confirmed in hard copy by
> an authorised signatory.
>
> Zaizi Ltd is registered in England and Wales with the registration number
> 6440931. The Registered Office is 203 Westbourne Studios, 242 Acklam Road,
> London W10 5JJ, UK.
--
-------------------------------------------------------------------
Richard Eckart de Castilho
Technical Lead
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117
[email protected]
www.ukp.tu-darmstadt.de
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------