uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommaso Teofili <tommaso.teof...@gmail.com>
Subject Re: SnowballAnnotator needs refactoring?
Date Wed, 01 Sep 2010 16:20:26 GMT
Hi Marshall,
I figured out that the issue regards the reconfigure() method within the old
API.
In fact in my use case I instantiate an aggregate AE which includes also a
SnowballAnnotator, after the first processing (no problem here) I don't
recreate the AE each time but only reconfigure it and that's where Snowball
fails.
I made the following test with the not-patched code:

try {

      AnalysisEngine ae = null;

      XMLInputSource in = new XMLInputSource("desc/SnowballAnnotator.xml");

      ResourceSpecifier specifier =
> UIMAFramework.getXMLParser().parseResourceSpecifier(in);


>       ae = UIMAFramework.produceAnalysisEngine(specifier);



      CAS cas =
> AnnotatorTester.getCASfromXCAS(JUnitExtension.getFile("typesystem.xml"),
> JUnitExtension.getFile("englishXCAS.xml"));



      ae.process(cas);



      ae.reconfigure();

    } catch (Exception e) {

      fail();

    }


and it fails; instead the bar is green with the patched version.
Hope this helps.
Cheers,
Tommaso


2010/8/31 Marshall Schor <msa@schor.com>

>  Hi Tommaso,
>
> Can you say more about the initialize() occasional failure?
>
> I'm curious as to what the failure is, and if you have any thoughts as to
> why is
> it "occasional"?  I took a quick look at the patch, but may have missed the
> part
> that addressed the occasional failure...
>
> Thanks!  -Marshall
>
> On 8/28/2010 6:48 AM, Tommaso Teofili wrote:
> > H all,
> > I noticed the SnowballAnnotator is extending the deprecated
> > JTextAnnotator_ImplBase, have some unused imports and generics should be
> > enabled.
> > Moreover the initialize() method occasionally fails due to the
> > AnnotatorContext object being null when run in a 2.3.1-SNAPSHOT
> > distribution.
> > I made a patch to make it extend JCasAnnotatorImpl_Base (and some little
> > refactorings [1]) that fixed this situation, but I would like to know if
> > anyone has experienced it and if have any objections on applying such a
> > patch.
> > Regards,
> > Tommaso
> >
> > [1] : https://issues.apache.org/jira/browse/UIMA-1861
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message