ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Masanz, James J." <Masanz.Ja...@mayo.edu>
Subject RE: cTAKES Groovy...
Date Wed, 18 Dec 2013 22:15:28 GMT

An update on how things are going with using cTAKES from groovy.

For my purposes, I switched from using grapes/@Grab annotations, to having the groovy script
run against what was extracted from the ctakes convenience binary (apache-ctakes-3.1.1-bin.zip)

I have two scripts. In the first (run_cTAKES.groovy), I set a variable pointing to where cTAKES
was extracted to, and another pointing to where the separately downloadable ctakesresources
(UMLS dictionary + LVG database) was extracted

Then I run the script. The script adds the following to the classpath dynamically using this.class.classLoader.rootLoader.addURL

 - almost all [1] the jars from cTAKES' lib directory
 - cTAKES' desc directory
 - cTAKES' resources directory
 - the directory where the separately downloadable ctakesresources was extracted

Then it starts the second script (cTAKES-clinical-pipeline.groovy) with 
evaluate(new File('cTAKES-clinical-pipeline.groovy'));

This is just FYI. I plan to share the scripts once they are in better shape.

-- James

[1] groovy and cTAKES do not play nice out of the box. I get the following if I include all
the jars from cTAKES bin distribution

Caught: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl
not found
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl
not found
        at org.apache.uima.util.impl.SaxDeserializer_impl.<clinit>(SaxDeserializer_impl.java:54)
        at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:174)
        at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:366)
        at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:347)
        at org.uimafit.factory.ResourceCreationSpecifierFactory.createResourceCreationSpecifier(ResourceCreationSpecifierFactory.java:76)
        at org.uimafit.factory.ResourceCreationSpecifierFactory.createResourceCreationSpecifier(ResourceCreationSpecifierFactory.java:55)
        at org.uimafit.factory.AnalysisEngineFactory.createAnalysisEngineDescription(AnalysisEngineFactory.java:110)
        at cTAKES-clinical-pipeline.run(cTAKES.groovy:74)
        at run_cTAKES.run(run_cTAKES.groovy:71)

So for now I skip adding the x*.jar files from the cTAKES convenience binary to the classpath.

-----Original Message-----
From: dev-return-2311-Masanz.James=mayo.edu@ctakes.apache.org [mailto:dev-return-2311-Masanz.James=mayo.edu@ctakes.apache.org]
On Behalf Of Richard Eckart de Castilho
Sent: Thursday, December 12, 2013 12:00 PM
To: dev@ctakes.apache.org
Subject: Re: cTAKES Groovy...

I tried with the small script (buh):

export JAVA_OPTS="-Dgroovy.grape.report.downloads=true $JAVA_OPTS"
HighFire-6:~ bluefire$ ./buh
Resolving dependency: edu.mit.findstruct#findstructapi;0.0.1 {default=[default]}
Preparing to download artifact edu.mit.findstruct#findstructapi;0.0.1!findstructapi.jar
Downloaded 13 Kbytes in 2326ms:
  [SUCCESSFUL ] edu.mit.findstruct#findstructapi;0.0.1!findstructapi.jar (2311ms)
Please specify input directory

looks ok to me.

-- Richard

On 12.12.2013, at 15:54, Tim Miller <timothy.miller@childrens.harvard.edu> wrote:

> I was able to replicate the error after removing the findstruct directories from my .groovy
and .m2 repositories.
> On 12/12/2013 12:22 PM, Masanz, James J. wrote:
>> Shouldn't be firewall - other grapes download fine.
>> I created a short groovy script to just grab findstructapi - I copy/pasted the @grab
line from from the Groovy Grape section of
>> http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar
>> And I still get
>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
>> General error during conversion: Error grabbing Grapes -- [download failed: edu.mit.findstruct#findstructapi;0.0.1!findstructapi.jar]
>> java.lang.RuntimeException: Error grabbing Grapes -- [download failed: edu.mit.findstruct#findstructapi;0.0.1!findstructapi.jar]
>> Very odd.
>> My script is simply:
>> #!/usr/bin/env groovy
>> @Grab(group='edu.mit.findstruct', module='findstructapi', version='0.0.1')
>> import java.io.File;
>> 		if(args.length < 1) {
>> 			System.out.println("Please specify input directory");
>> 			System.exit(1);
>> 		}
>> 		System.out.println("Input parm is: " + args[0]);
>> 		System.exit(0);

View raw message