Re: cTAKES Groovy…Examples? Relatively low effort, potentially game changing

2013-12-20 Thread John Green
I was in passionate agreement with this post by Andy, by the by.




JG

—
Sent from Mailbox for iPhone

On Wed, Dec 4, 2013 at 6:29 PM, Andrew McMurry mcmurry.a...@gmail.com
wrote:

 Most Open Source frameworks come with an project-examples.zip folder.  
 I can't help but think that the Groovy parser code and ctakes-gui make 
 excellent EXAMPLES for potential users. 
 https://svn.apache.org/repos/asf/ctakes/sandbox/
 Imagine if each ctakes-component had an example Groovy script that shows how 
 to use each component complete with the pubmed citation for each! 
 http://ctakes.apache.org/components.html
 Now imagine you could just download a VM and run the examples out of the 
 box. 
 I'll follow up in a separate thread about the VM progress. 
 I am passionate about improving the first time user experience. 
 Why? John Resig (creator of jQuery) gave a convincing (if not damning) 
 synopsis of how open source projects lose users. 
 I think our user base could be easily 10X if we follow his advice:  
 http://lanyrd.com/2009/harvard-open-source-retreat/scdrkh/
 Thoughts??  
 PS: My research interest in NLP/ machine learning methods is taking second 
 priority to helping the first time user experience. 
 It is imperative we get this stuff right. 
 On Dec 4, 2013, at 7:09 AM, Tim Miller timothy.mil...@childrens.harvard.edu 
 wrote:
 Very cool. I was noticing that it was downloading the umls resources which 
 the parser itself doesn't need -- so I made a change to not grab 
 clinical-pipeline and grab directly the things it was getting through that 
 reference and now it runs even faster with only a 35M initial download.
 
 I'd like to check in my change -- should we keep working out of sandbox or 
 can we maybe put groovy scripts somewhere alongside the projects they belong 
 to? Maybe in the scripts/ directory or scripts/groovy, scripts/perl, etc.? 
 Any opinions on this?
 
 Tim
 
 
 On 11/27/2013 12:19 PM, Chen, Pei wrote:
 The sample constituency parser printer should be working now...
 Just copy and paste the text to parser.groovy and make it executable.
 All you should need is groovy installed on your machine.
 http://svn.apache.org/repos/asf/ctakes/sandbox/groovy/parser.groovy
 $ parser.groovy input
 Reading from directory: input
  (TOP (S (NP-SBJ (NN patient)) (VP (VBD took) (NP (NP (NNS 50mg)) (PP (IN 
 of) (NP (NP (NN aspirin)) (PP (IN for) (NP (NP (NN pain)) (PP-LOC (IN in) 
 (NP (NN knee)(. .)))
 
 Maybe we could create one that will output UMLS CUI/Codes... and then 
 others could easily modify to their needs.
 
 --Pei
 -Original Message-
 From: William Karl Thompson [mailto:w...@northwestern.edu]
 Sent: Tuesday, November 26, 2013 10:46 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 That is very cool!
 
 Since we're talking Groovy, I'd just like make a plug for Gradle, a 
 fantastic
 build/deployment/dependency management tool that is in many ways much
 nicer to work with than Maven, though it plays nicely with Maven (for
 example, it can use Maven repositories). Gradle is also proven technology:
 it's the build tool for the Android operating system.
 
 From: Chen, Pei [pei.c...@childrens.harvard.edu]
 Sent: Tuesday, November 26, 2013 4:13 PM
 To: dev@ctakes.apache.org
 Subject: cTAKES Groovy...
 
 Tim had a good end user use case:
 I just want to use the ctakes constituency parser and output the tree text 
 to
 console.
 So I was inspired by Richard example of groovy...
 Check out:
 http://svn.apache.org/repos/asf/ctakes/sandbox/groovy/parser.groovy
 
 The groovy script will Automagically download the required
 classes,jars,resources and automatically runs.
 No longer requires the user to have any knowledge of UIMA, cTAKES, etc.
 Sample:
 $ parser.groovy input
 Reading from directory: input
 patient took 50mg of aspirin for pain in knee.
 begin:0 end:48
 
 Pretty cool, 'eh...
 --Pei
 

RE: cTAKES Groovy...

2013-12-12 Thread Masanz, James J.
The story continues:

The @GrabResolver line from Richard did the trick for jwnl.

But I cleared my .groovy/grapes and  .m2/repository and tried running 
parser.groovy and get the following:

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]

FYI. I will take a look but if anyone has any hints, don't be shy


-Original Message-
From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org 
[mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
Finan, Sean
Sent: Friday, December 06, 2013 2:38 PM
To: dev@ctakes.apache.org
Subject: RE: cTAKES Groovy...

Good stuff -  Thanks Richard

-Original Message-
From: Masanz, James J. [mailto:masanz.ja...@mayo.edu] 
Sent: Friday, December 06, 2013 3:30 PM
To: 'dev@ctakes.apache.org'
Subject: RE: cTAKES Groovy...

Thanks Richard! That did the trick

I'll create a JIRA and update the script including adding a comment that that 
@GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed when 
we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP 
dependency to 1.5.3 with a  reminder to update the script.

Trunk of cTAKES still uses 1.5.2-incubating

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

On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:

 I have not solved my issues on my ubuntu server yet where Error 
 grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]

This has also already been fixed in OpenNLP 1.5.3, so there must be some 
dependency on OpenNLP 1.5.(1|2)-incubating.

Anyway, you should be able to fix it by adding this to the beginning of your 
Groovy script, in front of the Grapes:

@GrabResolver(name='opennlp.sf.net', 
  root='http://opennlp.sourceforge.net/maven2')

-- Richard



Re: cTAKES Groovy...

2013-12-12 Thread Richard Eckart de Castilho
Might be a temporary network problem. The artifact is on Maven Central:

http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar

-- Richard

On 12.12.2013, at 15:01, Masanz, James J. masanz.ja...@mayo.edu wrote:

 The story continues:
 
 The @GrabResolver line from Richard did the trick for jwnl.
 
 But I cleared my .groovy/grapes and  .m2/repository and tried running 
 parser.groovy and get the following:
 
 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]
 
 FYI. I will take a look but if anyone has any hints, don't be shy
 
 
 -Original Message-
 From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
 Finan, Sean
 Sent: Friday, December 06, 2013 2:38 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Good stuff -  Thanks Richard
 
 -Original Message-
 From: Masanz, James J. [mailto:masanz.ja...@mayo.edu] 
 Sent: Friday, December 06, 2013 3:30 PM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...
 
 Thanks Richard! That did the trick
 
 I'll create a JIRA and update the script including adding a comment that that 
 @GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed 
 when we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP 
 dependency to 1.5.3 with a  reminder to update the script.
 
 Trunk of cTAKES still uses 1.5.2-incubating
 
 -Original Message-
 From: dev-return-2297-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2297-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
 Richard Eckart de Castilho
 Sent: Friday, December 06, 2013 2:12 PM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 I have not solved my issues on my ubuntu server yet where Error 
 grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]
 
 This has also already been fixed in OpenNLP 1.5.3, so there must be some 
 dependency on OpenNLP 1.5.(1|2)-incubating.
 
 Anyway, you should be able to fix it by adding this to the beginning of your 
 Groovy script, in front of the Grapes:
 
 @GrabResolver(name='opennlp.sf.net', 
  root='http://opennlp.sourceforge.net/maven2')
 
 -- Richard
 



RE: cTAKES Groovy...

2013-12-12 Thread Masanz, James J.
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);


-Original Message-
From: dev-return-2305-Masanz.James=mayo@ctakes.apache.org 
[mailto:dev-return-2305-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
William Karl Thompson
Sent: Thursday, December 12, 2013 11:06 AM
To: dev@ctakes.apache.org
Subject: RE: cTAKES Groovy...

Seems unlikely to be the source of your problem, but could it be a firewall 
issue?

-Original Message-
From: Richard Eckart de Castilho [mailto:r...@apache.org] 
Sent: Thursday, December 12, 2013 11:04 AM
To: dev@ctakes.apache.org
Subject: Re: cTAKES Groovy...

Might be a temporary network problem. The artifact is on Maven Central:

http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar

-- Richard

On 12.12.2013, at 15:01, Masanz, James J. masanz.ja...@mayo.edu wrote:

 The story continues:
 
 The @GrabResolver line from Richard did the trick for jwnl.
 
 But I cleared my .groovy/grapes and  .m2/repository and tried running 
 parser.groovy and get the following:
 
 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]
 
 FYI. I will take a look but if anyone has any hints, don't be shy
 
 
 -Original Message-
 From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Finan, Sean
 Sent: Friday, December 06, 2013 2:38 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Good stuff -  Thanks Richard
 
 -Original Message-
 From: Masanz, James J. [mailto:masanz.ja...@mayo.edu]
 Sent: Friday, December 06, 2013 3:30 PM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...
 
 Thanks Richard! That did the trick
 
 I'll create a JIRA and update the script including adding a comment that that 
 @GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed 
 when we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP 
 dependency to 1.5.3 with a  reminder to update the script.
 
 Trunk of cTAKES still uses 1.5.2-incubating
 
 -Original Message-
 From: dev-return-2297-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2297-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Richard Eckart de Castilho
 Sent: Friday, December 06, 2013 2:12 PM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 I have not solved my issues on my ubuntu server yet where Error 
 grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]
 
 This has also already been fixed in OpenNLP 1.5.3, so there must be some 
 dependency on OpenNLP 1.5.(1|2)-incubating.
 
 Anyway, you should be able to fix it by adding this to the beginning of your 
 Groovy script, in front of the Grapes:
 
 @GrabResolver(name='opennlp.sf.net', 
  root='http://opennlp.sourceforge.net/maven2')
 
 -- Richard
 



Re: cTAKES Groovy...

2013-12-12 Thread Richard Eckart de Castilho
I believe that Grape (like Maven) caches failures. It might be necessary to
delete any cached info on that artifact from your local grape repository 
before you try again. Btw. there you might (or might not) be able to find
additional information on why the download failed.

Check out the trouble-shooting section in the DKPro Core Groovy recipe page:

http://code.google.com/p/dkpro-core-asl/wiki/DKProGroovyCookbook#Trouble_shooting

on cache flushing and on enabling verbose information on Grape downloads.

-- Richard

On 12.12.2013, at 15:22, Masanz, James J. masanz.ja...@mayo.edu 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);
 
 
 -Original Message-
 From: dev-return-2305-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2305-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
 William Karl Thompson
 Sent: Thursday, December 12, 2013 11:06 AM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Seems unlikely to be the source of your problem, but could it be a firewall 
 issue?
 
 -Original Message-
 From: Richard Eckart de Castilho [mailto:r...@apache.org] 
 Sent: Thursday, December 12, 2013 11:04 AM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 Might be a temporary network problem. The artifact is on Maven Central:
 
 http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar
 
 -- Richard
 
 On 12.12.2013, at 15:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 The story continues:
 
 The @GrabResolver line from Richard did the trick for jwnl.
 
 But I cleared my .groovy/grapes and  .m2/repository and tried running 
 parser.groovy and get the following:
 
 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]
 
 FYI. I will take a look but if anyone has any hints, don't be shy
 
 
 -Original Message-
 From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Finan, Sean
 Sent: Friday, December 06, 2013 2:38 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Good stuff -  Thanks Richard
 
 -Original Message-
 From: Masanz, James J. [mailto:masanz.ja...@mayo.edu]
 Sent: Friday, December 06, 2013 3:30 PM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...
 
 Thanks Richard! That did the trick
 
 I'll create a JIRA and update the script including adding a comment that 
 that @GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be 
 removed when we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache 
 OpenNLP dependency to 1.5.3 with a  reminder to update the script.
 
 Trunk of cTAKES still uses 1.5.2-incubating
 
 -Original Message-
 From: dev-return-2297-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2297-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Richard Eckart de Castilho
 Sent: Friday, December 06, 2013 2:12 PM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 I have not solved my issues on my ubuntu server yet where Error 
 grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]
 
 This has also already been fixed in OpenNLP 1.5.3, so there must be some 
 dependency on OpenNLP 1.5.(1|2)-incubating.
 
 Anyway, you should be able to fix it by adding this to the beginning of your 
 Groovy script, in front of the Grapes:
 
 @GrabResolver(name='opennlp.sf.net', 
 root='http://opennlp.sourceforge.net/maven2')
 
 -- Richard



RE: cTAKES Groovy...

2013-12-12 Thread Masanz, James J.
Thanks Richard for the pointer to that page.  I'm sure I will use it in future.

I flushed cache - did not help. I finally just copied over 
.groovy/grapes/edu.mit.findstruct from another system and I am up and running.
Will try again in a  few days or weeks when I try another clean install test.

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

I believe that Grape (like Maven) caches failures. It might be necessary to
delete any cached info on that artifact from your local grape repository 
before you try again. Btw. there you might (or might not) be able to find
additional information on why the download failed.

Check out the trouble-shooting section in the DKPro Core Groovy recipe page:

http://code.google.com/p/dkpro-core-asl/wiki/DKProGroovyCookbook#Trouble_shooting

on cache flushing and on enabling verbose information on Grape downloads.

-- Richard

On 12.12.2013, at 15:22, Masanz, James J. masanz.ja...@mayo.edu 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);
 
 
 -Original Message-
 From: dev-return-2305-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2305-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
 William Karl Thompson
 Sent: Thursday, December 12, 2013 11:06 AM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Seems unlikely to be the source of your problem, but could it be a firewall 
 issue?
 
 -Original Message-
 From: Richard Eckart de Castilho [mailto:r...@apache.org] 
 Sent: Thursday, December 12, 2013 11:04 AM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 Might be a temporary network problem. The artifact is on Maven Central:
 
 http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar
 
 -- Richard
 
 On 12.12.2013, at 15:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 The story continues:
 
 The @GrabResolver line from Richard did the trick for jwnl.
 
 But I cleared my .groovy/grapes and  .m2/repository and tried running 
 parser.groovy and get the following:
 
 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]
 
 FYI. I will take a look but if anyone has any hints, don't be shy
 
 
 -Original Message-
 From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Finan, Sean
 Sent: Friday, December 06, 2013 2:38 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 Good stuff -  Thanks Richard
 
 -Original Message-
 From: Masanz, James J. [mailto:masanz.ja...@mayo.edu]
 Sent: Friday, December 06, 2013 3:30 PM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...
 
 Thanks Richard! That did the trick
 
 I'll create a JIRA and update the script including adding a comment that 
 that @GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be 
 removed when we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache 
 OpenNLP dependency to 1.5.3 with a  reminder to update the script.
 
 Trunk of cTAKES still uses 1.5.2-incubating
 
 -Original Message-
 From: dev-return-2297-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2297-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Richard Eckart de Castilho
 Sent: Friday, December 06, 2013 2:12 PM
 To: dev@ctakes.apache.org
 Subject: Re: cTAKES Groovy...
 
 On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:
 
 I

Re: cTAKES Groovy...

2013-12-12 Thread Tim Miller
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);


-Original Message-
From: dev-return-2305-Masanz.James=mayo@ctakes.apache.org 
[mailto:dev-return-2305-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
William Karl Thompson
Sent: Thursday, December 12, 2013 11:06 AM
To: dev@ctakes.apache.org
Subject: RE: cTAKES Groovy...

Seems unlikely to be the source of your problem, but could it be a firewall 
issue?

-Original Message-
From: Richard Eckart de Castilho [mailto:r...@apache.org]
Sent: Thursday, December 12, 2013 11:04 AM
To: dev@ctakes.apache.org
Subject: Re: cTAKES Groovy...

Might be a temporary network problem. The artifact is on Maven Central:

http://search.maven.org/#artifactdetails%7Cedu.mit.findstruct%7Cfindstructapi%7C0.0.1%7Cjar

-- Richard

On 12.12.2013, at 15:01, Masanz, James J. masanz.ja...@mayo.edu wrote:


The story continues:

The @GrabResolver line from Richard did the trick for jwnl.

But I cleared my .groovy/grapes and  .m2/repository and tried running 
parser.groovy and get the following:

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]

FYI. I will take a look but if anyone has any hints, don't be shy


-Original Message-
From: dev-return-2299-Masanz.James=mayo@ctakes.apache.org
[mailto:dev-return-2299-Masanz.James=mayo@ctakes.apache.org] On
Behalf Of Finan, Sean
Sent: Friday, December 06, 2013 2:38 PM
To: dev@ctakes.apache.org
Subject: RE: cTAKES Groovy...

Good stuff -  Thanks Richard

-Original Message-
From: Masanz, James J. [mailto:masanz.ja...@mayo.edu]
Sent: Friday, December 06, 2013 3:30 PM
To: 'dev@ctakes.apache.org'
Subject: RE: cTAKES Groovy...

Thanks Richard! That did the trick

I'll create a JIRA and update the script including adding a comment that that 
@GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed when we upgrade 
to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP dependency to 
1.5.3 with a  reminder to update the script.

Trunk of cTAKES still uses 1.5.2-incubating

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

On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:


I have not solved my issues on my ubuntu server yet where Error
grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]

This has also already been fixed in OpenNLP 1.5.3, so there must be some 
dependency on OpenNLP 1.5.(1|2)-incubating.

Anyway, you should be able to fix it by adding this to the beginning of your 
Groovy script, in front of the Grapes:

@GrabResolver(name='opennlp.sf.net',
  root='http://opennlp.sourceforge.net/maven2')

-- Richard





Re: cTAKES Groovy...

2013-12-12 Thread Richard Eckart de Castilho
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.mil...@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);


RE: cTAKES Groovy...

2013-12-06 Thread Masanz, James J.

Sounds like before publicizing  any groovy scripts we need to have some testing 
on clean Win and clean *nix systems.

FYI, after I fixed the typo I had in the script on my Windows 7 machine where I 
do cTAKES development (and hence has jwnl under my .m2) and set JAVA_OPTS to 
have enough heap space, I  have the groovy script running fine there.

I have not solved my issues on my ubuntu server yet where 
Error grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]

I'll try to get back to that another day.

Thanks all for the help.

-Original Message-
From: dev-return-2295-Masanz.James=mayo@ctakes.apache.org 
[mailto:dev-return-2295-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
Finan, Sean
Sent: Friday, December 06, 2013 1:46 PM
To: dev@ctakes.apache.org
Subject: RE: cTAKES Groovy...

Hi James,
As Tim states
 I have it in my .m2 directory

And I think that is why it is working for Tim.  You may -not- have the same 
version (if any) in your .m2 directory.  I have had problems maintaining 
multiple dev versions of cTakes on a single machine because of maven's 
utilization of the .m2 cache directory.  It is possible, but a pain.  That was 
an aside ...

If you do end up having a library in your .m2, then it is possible that grape 
is not using it by default on your machine (though I don't know why).   You can 
try the following from http://groovy.codehaus.org/Grape :

If you find yourself wanting to reuse artifacts that you already have locally 
in your Maven2 repository, then you can add this line to your 
~/.groovy/grapeConfig.xml:

ibiblio name=local root=file:${user.home}/.m2/repository/ 
m2compatible=true/





Anyway, it sounds like the script is not quite as standalone as it could be.  

-Original Message-
From: Tim Miller [mailto:timothy.mil...@childrens.harvard.edu] 
Sent: Friday, December 06, 2013 2:19 PM
To: dev@ctakes.apache.org
Subject: Re: cTAKES Groovy...

I have it in my .m2 directory timestamped October 2012. I believe the most 
recent versions of grape will look in m2 and grab from there if it exists.
Tim

On 12/06/2013 02:14 PM, Masanz, James J. wrote:
 Thanks Sean.

 Something doesn't seem to be working for me related to getting dependencies.

 I did a wget of the parser.groovy that Tim just checked in today.

 Then trying to run that groovy script I get this error:

 $  groovy parser.groovy  test-data-for-groovy/
 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
 failed:
 General error during conversion: Error grabbing Grapes -- [unresolved 
 dependency: jwnl#jwnl;1.3.3: not found]
 java.lang.RuntimeException: Error grabbing Grapes -- [unresolved 
 dependency: jwnl#jwnl;1.3.3: not found]

 So I tried this (I'm no grape expert but a google search led to this 
 suggestion) but it fails:
 $ grape -V resolve   jwnl  jwnl 1.3.3

 I see the following issue was created by opennlp that looks related
 https://issues.apache.org/jira/browse/OPENNLP-510
 saying that jwnl:jwnl 1.3.3 is no longer available (!)

 What I don't get is why no one else is seeing this error.
 Maybe everyone else already had that in their local maven repos? Hard to 
 believe though given OPENNLP-510 is from May 2012.

 Fyi:

 $groovy --version
 Groovy Version: 1.8.6 JVM: 1.6.0_27 Vendor: Sun Microsystems Inc. OS: 
 Linux


 -Original Message-
 From: dev-return-2288-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2288-Masanz.James=mayo@ctakes.apache.org] On 
 Behalf Of Finan, Sean
 Sent: Friday, December 06, 2013 11:19 AM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...

 Aside from a crash course almost 10 years ago, I haven't touched groovy very 
 much.  However, if you are having issues with shifts and files, you can 
 look here:

 http://blog.retep.org/category/development/java/groovy/

 He defines what he calls shift operators for the file operations.

 For all I know this is where Pei got his code, but it might be worth checking 
 if anybody runs into errors.

 -Original Message-
 From: Masanz, James J. [mailto:masanz.ja...@mayo.edu]
 Sent: Friday, December 06, 2013 12:13 PM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...

 FYI, the groovy error I was getting was a typo on my part

 I had this:
 out  new URL(url).openStream()
 instead of
 out  new URL(url).openStream()

 so it was trying to do a shift operation of some sort

 -Original Message-
 From: dev-return-2286-Masanz.James=mayo@ctakes.apache.org 
 [mailto:dev-return-2286-Masanz.James=mayo@ctakes.apache.org] On Behalf Of 
 Masanz, James J.
 Sent: Friday, December 06, 2013 11:03 AM
 To: 'dev@ctakes.apache.org'
 Subject: RE: cTAKES Groovy...

 Tim, could you check that change in you made to not download the big 
 resources, or post it somewhere temporarily.

 I'm having this issue when trying to run the  groovy script (I'm on Windows 
 7, if that makes a difference) and having it faster might help debug.

 C:\using-groovy groovy

RE: cTAKES Groovy...

2013-12-06 Thread Masanz, James J.
Thanks Richard! That did the trick

I'll create a JIRA and update the script including adding a comment that that 
@GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed when 
we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP 
dependency to 1.5.3 with a  reminder to update the script.

Trunk of cTAKES still uses 1.5.2-incubating

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

On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:

 I have not solved my issues on my ubuntu server yet where 
 Error grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]

This has also already been fixed in OpenNLP 1.5.3, so there must be some 
dependency on OpenNLP 1.5.(1|2)-incubating.

Anyway, you should be able to fix it by adding this to the beginning of your 
Groovy script, in front of the Grapes:

@GrabResolver(name='opennlp.sf.net', 
  root='http://opennlp.sourceforge.net/maven2')

-- Richard



RE: cTAKES Groovy...

2013-12-06 Thread Finan, Sean
Good stuff -  Thanks Richard

-Original Message-
From: Masanz, James J. [mailto:masanz.ja...@mayo.edu] 
Sent: Friday, December 06, 2013 3:30 PM
To: 'dev@ctakes.apache.org'
Subject: RE: cTAKES Groovy...

Thanks Richard! That did the trick

I'll create a JIRA and update the script including adding a comment that that 
@GrabResolver  is only needed for pre-OpenNLP 1.5.3 and should be removed when 
we upgrade to 1.5.3+. and I'll update CTAKES-191 Update Apache OpenNLP 
dependency to 1.5.3 with a  reminder to update the script.

Trunk of cTAKES still uses 1.5.2-incubating

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

On 06.12.2013, at 18:01, Masanz, James J. masanz.ja...@mayo.edu wrote:

 I have not solved my issues on my ubuntu server yet where Error 
 grabbing Grapes -- [unresolved dependency: jwnl#jwnl;1.3.3: not found]

This has also already been fixed in OpenNLP 1.5.3, so there must be some 
dependency on OpenNLP 1.5.(1|2)-incubating.

Anyway, you should be able to fix it by adding this to the beginning of your 
Groovy script, in front of the Grapes:

@GrabResolver(name='opennlp.sf.net', 
  root='http://opennlp.sourceforge.net/maven2')

-- Richard



RE: cTAKES Groovy...

2013-11-27 Thread Chen, Pei
The sample constituency parser printer should be working now...
Just copy and paste the text to parser.groovy and make it executable.
All you should need is groovy installed on your machine.
http://svn.apache.org/repos/asf/ctakes/sandbox/groovy/parser.groovy
$ parser.groovy input
Reading from directory: input
 (TOP (S (NP-SBJ (NN patient)) (VP (VBD took) (NP (NP (NNS 50mg)) (PP (IN of) 
(NP (NP (NN aspirin)) (PP (IN for) (NP (NP (NN pain)) (PP-LOC (IN in) (NP (NN 
knee)(. .)))

Maybe we could create one that will output UMLS CUI/Codes... and then others 
could easily modify to their needs.

--Pei
 -Original Message-
 From: William Karl Thompson [mailto:w...@northwestern.edu]
 Sent: Tuesday, November 26, 2013 10:46 PM
 To: dev@ctakes.apache.org
 Subject: RE: cTAKES Groovy...
 
 That is very cool!
 
 Since we're talking Groovy, I'd just like make a plug for Gradle, a fantastic
 build/deployment/dependency management tool that is in many ways much
 nicer to work with than Maven, though it plays nicely with Maven (for
 example, it can use Maven repositories). Gradle is also proven technology:
 it's the build tool for the Android operating system.
 
 From: Chen, Pei [pei.c...@childrens.harvard.edu]
 Sent: Tuesday, November 26, 2013 4:13 PM
 To: dev@ctakes.apache.org
 Subject: cTAKES Groovy...
 
 Tim had a good end user use case:
 I just want to use the ctakes constituency parser and output the tree text to
 console.
 So I was inspired by Richard example of groovy...
 Check out:
 http://svn.apache.org/repos/asf/ctakes/sandbox/groovy/parser.groovy
 
 The groovy script will Automagically download the required
 classes,jars,resources and automatically runs.
 No longer requires the user to have any knowledge of UIMA, cTAKES, etc.
 Sample:
 $ parser.groovy input
 Reading from directory: input
 patient took 50mg of aspirin for pain in knee.
 begin:0 end:48
 
 Pretty cool, 'eh...
 --Pei


Re: cTAKES Groovy...

2013-11-26 Thread Andrew McMurry
+1 on this direction 

AND having this as an out of the box option upon download is even better. 

--andy 

On Nov 26, 2013, at 2:13 PM, Chen, Pei pei.c...@childrens.harvard.edu wrote:

 Tim had a good end user use case:
 I just want to use the ctakes constituency parser and output the tree text to 
 console.
 So I was inspired by Richard example of groovy...
 Check out:
 http://svn.apache.org/repos/asf/ctakes/sandbox/groovy/parser.groovy
 
 The groovy script will Automagically download the required 
 classes,jars,resources and automatically runs.
 No longer requires the user to have any knowledge of UIMA, cTAKES, etc.
 Sample:
 $ parser.groovy input
 Reading from directory: input
 patient took 50mg of aspirin for pain in knee.
 begin:0 end:48
 
 Pretty cool, 'eh...
 --Pei