You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Erik Fäßler <er...@uni-jena.de> on 2020/03/04 15:10:48 UTC

Ruta: Loading ressources from classpath?

I have created a Ruta script and now I want it to use as a UIMA AE. Thanks to the Maven plugin, I created the AE descriptor which I could get to work easily.
I have packaged the whole component into a single JAR which I then use via the Maven dependency mechanism. This works fine until I try to use a word list. It seems that while script and descriptor files can be loaded from a classpath location, this does not work for resources.

Right now I have the impression that I would have to deliver not only file paths but even absolute file paths as the JavaDocs suggest.

Would it be possible to change this and allow a classpath lookup like for the script file? I would really like to just package everything into a JAR and avoid a non-portable installation due to absolute paths.

Are there other possibilities to achieve portability when using word lists?

Thanks,

Erik

Re: Ruta: Loading ressources from classpath?

Posted by Peter Klügl <pe...@averbis.com>.
Ok :-)

Am 05.03.2020 um 14:41 schrieb Erik Fäßler:
> Hi again,
>
> so i found that one actually can load resources from classpath. I didn’t realize that I needed to provide the path directly to the script e.g.
> WORDLIST GreekList = "ruta/resources/GreekAlphabet.txt";
> instead I tried to let the resourcePaths point to classpath locations which didn’t work.
>
> So sorry to bother, I got it now :-)
>
>> On 5. Mar 2020, at 12:56, Peter Klügl <pe...@averbis.com> wrote:
>>
>> Hi Erik,
>>
>>
>> I thought classpath lookup should be possible. I'll check that and get
>> back to you (probably tomorrow)
>>
>>
>> Best,
>>
>>
>> Peter
>>
>>
>> Am 04.03.2020 um 16:10 schrieb Erik Fäßler:
>>> I have created a Ruta script and now I want it to use as a UIMA AE. Thanks to the Maven plugin, I created the AE descriptor which I could get to work easily.
>>> I have packaged the whole component into a single JAR which I then use via the Maven dependency mechanism. This works fine until I try to use a word list. It seems that while script and descriptor files can be loaded from a classpath location, this does not work for resources.
>>>
>>> Right now I have the impression that I would have to deliver not only file paths but even absolute file paths as the JavaDocs suggest.
>>>
>>> Would it be possible to change this and allow a classpath lookup like for the script file? I would really like to just package everything into a JAR and avoid a non-portable installation due to absolute paths.
>>>
>>> Are there other possibilities to achieve portability when using word lists?
>>>
>>> Thanks,
>>>
>>> Erik
>> -- 
>> Dr. Peter Klügl
>> R&D Text Mining/Machine Learning
>>
>> Averbis GmbH
>> Salzstr. 15
>> 79098 Freiburg
>> Germany
>>
>> Fon: +49 761 708 394 0
>> Fax: +49 761 708 394 10
>> Email: peter.kluegl@averbis.com
>> Web: https://averbis.com
>>
>> Headquarters: Freiburg im Breisgau
>> Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
>> Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó
>>
>
-- 
Dr. Peter Klügl
R&D Text Mining/Machine Learning

Averbis GmbH
Salzstr. 15
79098 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.kluegl@averbis.com
Web: https://averbis.com

Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó


Re: Ruta: Loading ressources from classpath?

Posted by Erik Fäßler <er...@uni-jena.de>.
Hi again,

so i found that one actually can load resources from classpath. I didn’t realize that I needed to provide the path directly to the script e.g.
WORDLIST GreekList = "ruta/resources/GreekAlphabet.txt";
instead I tried to let the resourcePaths point to classpath locations which didn’t work.

So sorry to bother, I got it now :-)

> On 5. Mar 2020, at 12:56, Peter Klügl <pe...@averbis.com> wrote:
> 
> Hi Erik,
> 
> 
> I thought classpath lookup should be possible. I'll check that and get
> back to you (probably tomorrow)
> 
> 
> Best,
> 
> 
> Peter
> 
> 
> Am 04.03.2020 um 16:10 schrieb Erik Fäßler:
>> I have created a Ruta script and now I want it to use as a UIMA AE. Thanks to the Maven plugin, I created the AE descriptor which I could get to work easily.
>> I have packaged the whole component into a single JAR which I then use via the Maven dependency mechanism. This works fine until I try to use a word list. It seems that while script and descriptor files can be loaded from a classpath location, this does not work for resources.
>> 
>> Right now I have the impression that I would have to deliver not only file paths but even absolute file paths as the JavaDocs suggest.
>> 
>> Would it be possible to change this and allow a classpath lookup like for the script file? I would really like to just package everything into a JAR and avoid a non-portable installation due to absolute paths.
>> 
>> Are there other possibilities to achieve portability when using word lists?
>> 
>> Thanks,
>> 
>> Erik
> 
> -- 
> Dr. Peter Klügl
> R&D Text Mining/Machine Learning
> 
> Averbis GmbH
> Salzstr. 15
> 79098 Freiburg
> Germany
> 
> Fon: +49 761 708 394 0
> Fax: +49 761 708 394 10
> Email: peter.kluegl@averbis.com
> Web: https://averbis.com
> 
> Headquarters: Freiburg im Breisgau
> Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
> Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó
> 


Re: Ruta: Loading ressources from classpath?

Posted by Erik Fäßler <er...@uni-jena.de>.
Hi Peter,

thank you! To be honest I just realized that I am not able to read the resources in any way. It works in the Eclipse Ruta workbench but not in my external project for some reason.
Still it would be nice to know if classpath loading of resources should be possible anyway, thanks!

Best,

Erik

> On 5. Mar 2020, at 12:56, Peter Klügl <pe...@averbis.com> wrote:
> 
> Hi Erik,
> 
> 
> I thought classpath lookup should be possible. I'll check that and get
> back to you (probably tomorrow)
> 
> 
> Best,
> 
> 
> Peter
> 
> 
> Am 04.03.2020 um 16:10 schrieb Erik Fäßler:
>> I have created a Ruta script and now I want it to use as a UIMA AE. Thanks to the Maven plugin, I created the AE descriptor which I could get to work easily.
>> I have packaged the whole component into a single JAR which I then use via the Maven dependency mechanism. This works fine until I try to use a word list. It seems that while script and descriptor files can be loaded from a classpath location, this does not work for resources.
>> 
>> Right now I have the impression that I would have to deliver not only file paths but even absolute file paths as the JavaDocs suggest.
>> 
>> Would it be possible to change this and allow a classpath lookup like for the script file? I would really like to just package everything into a JAR and avoid a non-portable installation due to absolute paths.
>> 
>> Are there other possibilities to achieve portability when using word lists?
>> 
>> Thanks,
>> 
>> Erik
> 
> -- 
> Dr. Peter Klügl
> R&D Text Mining/Machine Learning
> 
> Averbis GmbH
> Salzstr. 15
> 79098 Freiburg
> Germany
> 
> Fon: +49 761 708 394 0
> Fax: +49 761 708 394 10
> Email: peter.kluegl@averbis.com
> Web: https://averbis.com
> 
> Headquarters: Freiburg im Breisgau
> Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
> Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó
> 


Re: Ruta: Loading ressources from classpath?

Posted by Peter Klügl <pe...@averbis.com>.
Hi Erik,


I thought classpath lookup should be possible. I'll check that and get
back to you (probably tomorrow)


Best,


Peter


Am 04.03.2020 um 16:10 schrieb Erik Fäßler:
> I have created a Ruta script and now I want it to use as a UIMA AE. Thanks to the Maven plugin, I created the AE descriptor which I could get to work easily.
> I have packaged the whole component into a single JAR which I then use via the Maven dependency mechanism. This works fine until I try to use a word list. It seems that while script and descriptor files can be loaded from a classpath location, this does not work for resources.
>
> Right now I have the impression that I would have to deliver not only file paths but even absolute file paths as the JavaDocs suggest.
>
> Would it be possible to change this and allow a classpath lookup like for the script file? I would really like to just package everything into a JAR and avoid a non-portable installation due to absolute paths.
>
> Are there other possibilities to achieve portability when using word lists?
>
> Thanks,
>
> Erik

-- 
Dr. Peter Klügl
R&D Text Mining/Machine Learning

Averbis GmbH
Salzstr. 15
79098 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.kluegl@averbis.com
Web: https://averbis.com

Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó