You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Debbie Zhang <de...@gmail.com> on 2014/05/02 09:36:15 UTC

RandomAccessFile problem in UIMA

Hi,

 

I am having problems to use JWNL wordnet in UIMA. 

 

JWNL uses RandomAccessFile to read wordnet dictionary files. In order to
create a PEAR file, wordnet dictionary files are put in resources/wordnet
folder under project. As resources is in my Build Path, I have no problem to
run the application I created in Eclipse. Therefore, I am  certain the
dictionary files can be read. However, when I use UIMA Document Analyzer or
UIMA CAS Visual Debugger to run the annotation, I get the following error:

 

java.io.FileNotFoundException: resources/wordnet/data.noun (No such file or
directory)  

 

The error comes from the following code:

 

RandomAccess _file = new RandomAccessFile(path, _permissions);

 

I use the following code to check the current working directory of the
class: 

 

URL location =
PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCodeSourc
e().getLocation();

System.out.println(location.getFile());

 

It seems both situation have the same location: /project/bin/

 

Did anyone encounter a similar problem before? Any suggestion is welcome.
Thank you!

 

Regards,

 

Debbie 

 


Re: RandomAccessFile problem in UIMA

Posted by Alexandre Patry <al...@keatext.com>.
Hi Debbie,

I do not use eclipse, I won't be of any help regarding maven and eclipse 
interoperability. The simplest thing is probably to download extJWNL 
from http://sourceforge.net/projects/extjwnl/files/ and add all jars 
under the lib/ directory in your project. Once it is done, you should be 
able to load the dictionary with the following line of code:

     Dictionary dictionary = Dictionary.getDefaultResourceInstance();

Let me know if it helps,

Alexandre

On 14-05-02 08:47 PM, Debbie Zhang wrote:
> Thanks Alexandre for your reply!
>
> I will try extJWNL as suggested. As I have never used maven, may I ask which
> maven Eclipse plugin you use?
>
> Thanks again for your help!
>
> Regards,
>
> Debbie
>
>
>> -----Original Message-----
>> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
>> Sent: Saturday, 3 May 2014 12:13 AM
>> To: user@uima.apache.org
>> Subject: Re: RandomAccessFile problem in UIMA
>>
>> Hi Debbie,
>>
>> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
>> instead of JWNL. We made the switch from JWNL and never looked back.
>>
>> For your path problems, extJWNL distribute WordNet dictionaries as
>> maven dependencies. It should become a non-issue.
>>
>> Hope this help,
>>
>> Alexandre
>>
>> On 02/05/2014 03:36, Debbie Zhang wrote:
>>> Hi,
>>>
>>>
>>>
>>> I am having problems to use JWNL wordnet in UIMA.
>>>
>>>
>>>
>>> JWNL uses RandomAccessFile to read wordnet dictionary files. In order
>>> to create a PEAR file, wordnet dictionary files are put in
>>> resources/wordnet folder under project. As resources is in my Build
>>> Path, I have no problem to run the application I created in Eclipse.
>>> Therefore, I am  certain the dictionary files can be read. However,
>>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to run
>> the annotation, I get the following error:
>>>
>>>
>>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
>>> file or
>>> directory)
>>>
>>>
>>>
>>> The error comes from the following code:
>>>
>>>
>>>
>>> RandomAccess _file = new RandomAccessFile(path, _permissions);
>>>
>>>
>>>
>>> I use the following code to check the current working directory of
>> the
>>> class:
>>>
>>>
>>>
>>> URL location =
>>>
>> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCod
>>> eSourc
>>> e().getLocation();
>>>
>>> System.out.println(location.getFile());
>>>
>>>
>>>
>>> It seems both situation have the same location: /project/bin/
>>>
>>>
>>>
>>> Did anyone encounter a similar problem before? Any suggestion is
>> welcome.
>>> Thank you!
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> Debbie
>>>
>>>
>>>
>>>
>>
>> --
>> Alexandre Patry, Ph.D
>> Chercheur / Researcher
>> http://KeaText.com
>


-- 
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com


Re: RandomAccessFile problem in UIMA

Posted by Michael Tanenblatt <sl...@park-slope.net>.
Eclipse does have built-in Maven support, which (at least in the Kepler build) works fine for me.

..Michael


On May 2, 2014, at 8:47 PM, Debbie Zhang <de...@gmail.com> wrote:

> Thanks Alexandre for your reply!
> 
> I will try extJWNL as suggested. As I have never used maven, may I ask which
> maven Eclipse plugin you use? 
> 
> Thanks again for your help!
> 
> Regards,
> 
> Debbie
> 
> 
>> -----Original Message-----
>> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
>> Sent: Saturday, 3 May 2014 12:13 AM
>> To: user@uima.apache.org
>> Subject: Re: RandomAccessFile problem in UIMA
>> 
>> Hi Debbie,
>> 
>> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
>> instead of JWNL. We made the switch from JWNL and never looked back.
>> 
>> For your path problems, extJWNL distribute WordNet dictionaries as
>> maven dependencies. It should become a non-issue.
>> 
>> Hope this help,
>> 
>> Alexandre
>> 
>> On 02/05/2014 03:36, Debbie Zhang wrote:
>>> Hi,
>>> 
>>> 
>>> 
>>> I am having problems to use JWNL wordnet in UIMA.
>>> 
>>> 
>>> 
>>> JWNL uses RandomAccessFile to read wordnet dictionary files. In order
>>> to create a PEAR file, wordnet dictionary files are put in
>>> resources/wordnet folder under project. As resources is in my Build
>>> Path, I have no problem to run the application I created in Eclipse.
>>> Therefore, I am  certain the dictionary files can be read. However,
>>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to run
>> the annotation, I get the following error:
>>> 
>>> 
>>> 
>>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
>>> file or
>>> directory)
>>> 
>>> 
>>> 
>>> The error comes from the following code:
>>> 
>>> 
>>> 
>>> RandomAccess _file = new RandomAccessFile(path, _permissions);
>>> 
>>> 
>>> 
>>> I use the following code to check the current working directory of
>> the
>>> class:
>>> 
>>> 
>>> 
>>> URL location =
>>> 
>> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCod
>>> eSourc
>>> e().getLocation();
>>> 
>>> System.out.println(location.getFile());
>>> 
>>> 
>>> 
>>> It seems both situation have the same location: /project/bin/
>>> 
>>> 
>>> 
>>> Did anyone encounter a similar problem before? Any suggestion is
>> welcome.
>>> Thank you!
>>> 
>>> 
>>> 
>>> Regards,
>>> 
>>> 
>>> 
>>> Debbie
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> --
>> Alexandre Patry, Ph.D
>> Chercheur / Researcher
>> http://KeaText.com
> 
> 


Re: RandomAccessFile problem in UIMA

Posted by Burn Lewis <bu...@gmail.com>.
You don't need to modify the distributed UIMA scripts ... you can set the
environment variable UIMA_CLASSPATH to hold the paths to the resources your
application needs and these will be placed at the head of the classpath.
Also anything in the CLASSPATH environment variable will be added to the
end of the classpath, after the classes that the UIMA framework needs.
(See runUimaClass.sh/.bat)

Unfortunately the UIMA documentation mentions only one of these:
    Note that if you're planning to run an Analysis Engine other than one
of the examples included in the UIMA SDK, you'll first need to update your
CLASSPATH environment variable to include the classes needed by that
Analysis Engine.

Burn


On Mon, May 5, 2014 at 11:52 AM, Thomas Ginter <th...@utah.edu>wrote:

> Hi Debbie,
>
> If you are launching the Document Analyzer through the batch file provided
> in the UIMA distribution then it is unable to find your resource directory
> because that is not included in the class path.  If you modify the class
> path that is built in the batch file to include your project resource
> directory then it should be able to find your files.
>
> Thanks,
>
> Thomas Ginter
> 801-448-7676
> thomas.ginter@utah.edu
>
>
>
>
> On May 5, 2014, at 4:22 AM, Debbie Zhang <de...@gmail.com> wrote:
>
> > Thanks everyone who replied.
> >
> > I finally got extJWNL partially working. It works on Eclipse, PEAR file,
> CAS
> > Visual Debugger on installed PEAR, and the system I deploy my PEAR files
> to.
> > However, it still doesn't work on Document Analyzer for unknown reason.
> >
> > Regards,
> >
> > Debbie
> >
> >> -----Original Message-----
> >> From: Marshall Schor [mailto:msa@schor.com]
> >> Sent: Monday, 5 May 2014 4:25 AM
> >> To: user@uima.apache.org
> >> Subject: Re: RandomAccessFile problem in UIMA
> >>
> >> The Eclipse feature to is "m2e".
> >>
> >> -Marshall
> >> On 5/2/2014 8:47 PM, Debbie Zhang wrote:
> >>> Thanks Alexandre for your reply!
> >>>
> >>> I will try extJWNL as suggested. As I have never used maven, may I
> >> ask
> >>> which maven Eclipse plugin you use?
> >>>
> >>> Thanks again for your help!
> >>>
> >>> Regards,
> >>>
> >>> Debbie
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
> >>>> Sent: Saturday, 3 May 2014 12:13 AM
> >>>> To: user@uima.apache.org
> >>>> Subject: Re: RandomAccessFile problem in UIMA
> >>>>
> >>>> Hi Debbie,
> >>>>
> >>>> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
> >>>> instead of JWNL. We made the switch from JWNL and never looked back.
> >>>>
> >>>> For your path problems, extJWNL distribute WordNet dictionaries as
> >>>> maven dependencies. It should become a non-issue.
> >>>>
> >>>> Hope this help,
> >>>>
> >>>> Alexandre
> >>>>
> >>>> On 02/05/2014 03:36, Debbie Zhang wrote:
> >>>>> Hi,
> >>>>>
> >>>>>
> >>>>>
> >>>>> I am having problems to use JWNL wordnet in UIMA.
> >>>>>
> >>>>>
> >>>>>
> >>>>> JWNL uses RandomAccessFile to read wordnet dictionary files. In
> >>>>> order to create a PEAR file, wordnet dictionary files are put in
> >>>>> resources/wordnet folder under project. As resources is in my Build
> >>>>> Path, I have no problem to run the application I created in Eclipse.
> >>>>> Therefore, I am  certain the dictionary files can be read. However,
> >>>>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to
> >> run
> >>>> the annotation, I get the following error:
> >>>>>
> >>>>>
> >>>>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
> >>>>> file or
> >>>>> directory)
> >>>>>
> >>>>>
> >>>>>
> >>>>> The error comes from the following code:
> >>>>>
> >>>>>
> >>>>>
> >>>>> RandomAccess _file = new RandomAccessFile(path, _permissions);
> >>>>>
> >>>>>
> >>>>>
> >>>>> I use the following code to check the current working directory of
> >>>> the
> >>>>> class:
> >>>>>
> >>>>>
> >>>>>
> >>>>> URL location =
> >>>>>
> >>>>
> >> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCo
> >>>> d
> >>>>> eSourc
> >>>>> e().getLocation();
> >>>>>
> >>>>> System.out.println(location.getFile());
> >>>>>
> >>>>>
> >>>>>
> >>>>> It seems both situation have the same location: /project/bin/
> >>>>>
> >>>>>
> >>>>>
> >>>>> Did anyone encounter a similar problem before? Any suggestion is
> >>>> welcome.
> >>>>> Thank you!
> >>>>>
> >>>>>
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>>
> >>>>>
> >>>>> Debbie
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> Alexandre Patry, Ph.D
> >>>> Chercheur / Researcher
> >>>> http://KeaText.com
> >>>
> >>>
> >>>
> >
> >
>
>

Re: RandomAccessFile problem in UIMA

Posted by Thomas Ginter <th...@utah.edu>.
Hi Debbie,

If you are launching the Document Analyzer through the batch file provided in the UIMA distribution then it is unable to find your resource directory because that is not included in the class path.  If you modify the class path that is built in the batch file to include your project resource directory then it should be able to find your files.

Thanks,

Thomas Ginter
801-448-7676
thomas.ginter@utah.edu




On May 5, 2014, at 4:22 AM, Debbie Zhang <de...@gmail.com> wrote:

> Thanks everyone who replied.
> 
> I finally got extJWNL partially working. It works on Eclipse, PEAR file, CAS
> Visual Debugger on installed PEAR, and the system I deploy my PEAR files to.
> However, it still doesn't work on Document Analyzer for unknown reason. 
> 
> Regards,
> 
> Debbie
> 
>> -----Original Message-----
>> From: Marshall Schor [mailto:msa@schor.com]
>> Sent: Monday, 5 May 2014 4:25 AM
>> To: user@uima.apache.org
>> Subject: Re: RandomAccessFile problem in UIMA
>> 
>> The Eclipse feature to is "m2e".
>> 
>> -Marshall
>> On 5/2/2014 8:47 PM, Debbie Zhang wrote:
>>> Thanks Alexandre for your reply!
>>> 
>>> I will try extJWNL as suggested. As I have never used maven, may I
>> ask
>>> which maven Eclipse plugin you use?
>>> 
>>> Thanks again for your help!
>>> 
>>> Regards,
>>> 
>>> Debbie
>>> 
>>> 
>>>> -----Original Message-----
>>>> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
>>>> Sent: Saturday, 3 May 2014 12:13 AM
>>>> To: user@uima.apache.org
>>>> Subject: Re: RandomAccessFile problem in UIMA
>>>> 
>>>> Hi Debbie,
>>>> 
>>>> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
>>>> instead of JWNL. We made the switch from JWNL and never looked back.
>>>> 
>>>> For your path problems, extJWNL distribute WordNet dictionaries as
>>>> maven dependencies. It should become a non-issue.
>>>> 
>>>> Hope this help,
>>>> 
>>>> Alexandre
>>>> 
>>>> On 02/05/2014 03:36, Debbie Zhang wrote:
>>>>> Hi,
>>>>> 
>>>>> 
>>>>> 
>>>>> I am having problems to use JWNL wordnet in UIMA.
>>>>> 
>>>>> 
>>>>> 
>>>>> JWNL uses RandomAccessFile to read wordnet dictionary files. In
>>>>> order to create a PEAR file, wordnet dictionary files are put in
>>>>> resources/wordnet folder under project. As resources is in my Build
>>>>> Path, I have no problem to run the application I created in Eclipse.
>>>>> Therefore, I am  certain the dictionary files can be read. However,
>>>>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to
>> run
>>>> the annotation, I get the following error:
>>>>> 
>>>>> 
>>>>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
>>>>> file or
>>>>> directory)
>>>>> 
>>>>> 
>>>>> 
>>>>> The error comes from the following code:
>>>>> 
>>>>> 
>>>>> 
>>>>> RandomAccess _file = new RandomAccessFile(path, _permissions);
>>>>> 
>>>>> 
>>>>> 
>>>>> I use the following code to check the current working directory of
>>>> the
>>>>> class:
>>>>> 
>>>>> 
>>>>> 
>>>>> URL location =
>>>>> 
>>>> 
>> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCo
>>>> d
>>>>> eSourc
>>>>> e().getLocation();
>>>>> 
>>>>> System.out.println(location.getFile());
>>>>> 
>>>>> 
>>>>> 
>>>>> It seems both situation have the same location: /project/bin/
>>>>> 
>>>>> 
>>>>> 
>>>>> Did anyone encounter a similar problem before? Any suggestion is
>>>> welcome.
>>>>> Thank you!
>>>>> 
>>>>> 
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> 
>>>>> 
>>>>> Debbie
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> --
>>>> Alexandre Patry, Ph.D
>>>> Chercheur / Researcher
>>>> http://KeaText.com
>>> 
>>> 
>>> 
> 
> 


RE: RandomAccessFile problem in UIMA

Posted by Debbie Zhang <de...@gmail.com>.
Thanks everyone who replied.

I finally got extJWNL partially working. It works on Eclipse, PEAR file, CAS
Visual Debugger on installed PEAR, and the system I deploy my PEAR files to.
However, it still doesn't work on Document Analyzer for unknown reason. 

Regards,

Debbie

> -----Original Message-----
> From: Marshall Schor [mailto:msa@schor.com]
> Sent: Monday, 5 May 2014 4:25 AM
> To: user@uima.apache.org
> Subject: Re: RandomAccessFile problem in UIMA
> 
> The Eclipse feature to is "m2e".
> 
> -Marshall
> On 5/2/2014 8:47 PM, Debbie Zhang wrote:
> > Thanks Alexandre for your reply!
> >
> > I will try extJWNL as suggested. As I have never used maven, may I
> ask
> > which maven Eclipse plugin you use?
> >
> > Thanks again for your help!
> >
> > Regards,
> >
> > Debbie
> >
> >
> >> -----Original Message-----
> >> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
> >> Sent: Saturday, 3 May 2014 12:13 AM
> >> To: user@uima.apache.org
> >> Subject: Re: RandomAccessFile problem in UIMA
> >>
> >> Hi Debbie,
> >>
> >> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
> >> instead of JWNL. We made the switch from JWNL and never looked back.
> >>
> >> For your path problems, extJWNL distribute WordNet dictionaries as
> >> maven dependencies. It should become a non-issue.
> >>
> >> Hope this help,
> >>
> >> Alexandre
> >>
> >> On 02/05/2014 03:36, Debbie Zhang wrote:
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I am having problems to use JWNL wordnet in UIMA.
> >>>
> >>>
> >>>
> >>> JWNL uses RandomAccessFile to read wordnet dictionary files. In
> >>> order to create a PEAR file, wordnet dictionary files are put in
> >>> resources/wordnet folder under project. As resources is in my Build
> >>> Path, I have no problem to run the application I created in Eclipse.
> >>> Therefore, I am  certain the dictionary files can be read. However,
> >>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to
> run
> >> the annotation, I get the following error:
> >>>
> >>>
> >>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
> >>> file or
> >>> directory)
> >>>
> >>>
> >>>
> >>> The error comes from the following code:
> >>>
> >>>
> >>>
> >>> RandomAccess _file = new RandomAccessFile(path, _permissions);
> >>>
> >>>
> >>>
> >>> I use the following code to check the current working directory of
> >> the
> >>> class:
> >>>
> >>>
> >>>
> >>> URL location =
> >>>
> >>
> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCo
> >> d
> >>> eSourc
> >>> e().getLocation();
> >>>
> >>> System.out.println(location.getFile());
> >>>
> >>>
> >>>
> >>> It seems both situation have the same location: /project/bin/
> >>>
> >>>
> >>>
> >>> Did anyone encounter a similar problem before? Any suggestion is
> >> welcome.
> >>> Thank you!
> >>>
> >>>
> >>>
> >>> Regards,
> >>>
> >>>
> >>>
> >>> Debbie
> >>>
> >>>
> >>>
> >>>
> >>
> >> --
> >> Alexandre Patry, Ph.D
> >> Chercheur / Researcher
> >> http://KeaText.com
> >
> >
> >



Re: RandomAccessFile problem in UIMA

Posted by Marshall Schor <ms...@schor.com>.
The Eclipse feature to is "m2e".

-Marshall
On 5/2/2014 8:47 PM, Debbie Zhang wrote:
> Thanks Alexandre for your reply!
>
> I will try extJWNL as suggested. As I have never used maven, may I ask which
> maven Eclipse plugin you use? 
>
> Thanks again for your help!
>
> Regards,
>
> Debbie
>
>
>> -----Original Message-----
>> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
>> Sent: Saturday, 3 May 2014 12:13 AM
>> To: user@uima.apache.org
>> Subject: Re: RandomAccessFile problem in UIMA
>>
>> Hi Debbie,
>>
>> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
>> instead of JWNL. We made the switch from JWNL and never looked back.
>>
>> For your path problems, extJWNL distribute WordNet dictionaries as
>> maven dependencies. It should become a non-issue.
>>
>> Hope this help,
>>
>> Alexandre
>>
>> On 02/05/2014 03:36, Debbie Zhang wrote:
>>> Hi,
>>>
>>>
>>>
>>> I am having problems to use JWNL wordnet in UIMA.
>>>
>>>
>>>
>>> JWNL uses RandomAccessFile to read wordnet dictionary files. In order
>>> to create a PEAR file, wordnet dictionary files are put in
>>> resources/wordnet folder under project. As resources is in my Build
>>> Path, I have no problem to run the application I created in Eclipse.
>>> Therefore, I am  certain the dictionary files can be read. However,
>>> when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to run
>> the annotation, I get the following error:
>>>
>>>
>>> java.io.FileNotFoundException: resources/wordnet/data.noun (No such
>>> file or
>>> directory)
>>>
>>>
>>>
>>> The error comes from the following code:
>>>
>>>
>>>
>>> RandomAccess _file = new RandomAccessFile(path, _permissions);
>>>
>>>
>>>
>>> I use the following code to check the current working directory of
>> the
>>> class:
>>>
>>>
>>>
>>> URL location =
>>>
>> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCod
>>> eSourc
>>> e().getLocation();
>>>
>>> System.out.println(location.getFile());
>>>
>>>
>>>
>>> It seems both situation have the same location: /project/bin/
>>>
>>>
>>>
>>> Did anyone encounter a similar problem before? Any suggestion is
>> welcome.
>>> Thank you!
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> Debbie
>>>
>>>
>>>
>>>
>>
>> --
>> Alexandre Patry, Ph.D
>> Chercheur / Researcher
>> http://KeaText.com
>
>
>


RE: RandomAccessFile problem in UIMA

Posted by Debbie Zhang <de...@gmail.com>.
Thanks Alexandre for your reply!

I will try extJWNL as suggested. As I have never used maven, may I ask which
maven Eclipse plugin you use? 

Thanks again for your help!

Regards,

Debbie


> -----Original Message-----
> From: Alexandre Patry [mailto:alexandre.patry@keatext.com]
> Sent: Saturday, 3 May 2014 12:13 AM
> To: user@uima.apache.org
> Subject: Re: RandomAccessFile problem in UIMA
> 
> Hi Debbie,
> 
> I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl)
> instead of JWNL. We made the switch from JWNL and never looked back.
> 
> For your path problems, extJWNL distribute WordNet dictionaries as
> maven dependencies. It should become a non-issue.
> 
> Hope this help,
> 
> Alexandre
> 
> On 02/05/2014 03:36, Debbie Zhang wrote:
> > Hi,
> >
> >
> >
> > I am having problems to use JWNL wordnet in UIMA.
> >
> >
> >
> > JWNL uses RandomAccessFile to read wordnet dictionary files. In order
> > to create a PEAR file, wordnet dictionary files are put in
> > resources/wordnet folder under project. As resources is in my Build
> > Path, I have no problem to run the application I created in Eclipse.
> > Therefore, I am  certain the dictionary files can be read. However,
> > when I use UIMA Document Analyzer or UIMA CAS Visual Debugger to run
> the annotation, I get the following error:
> >
> >
> >
> > java.io.FileNotFoundException: resources/wordnet/data.noun (No such
> > file or
> > directory)
> >
> >
> >
> > The error comes from the following code:
> >
> >
> >
> > RandomAccess _file = new RandomAccessFile(path, _permissions);
> >
> >
> >
> > I use the following code to check the current working directory of
> the
> > class:
> >
> >
> >
> > URL location =
> >
> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCod
> > eSourc
> > e().getLocation();
> >
> > System.out.println(location.getFile());
> >
> >
> >
> > It seems both situation have the same location: /project/bin/
> >
> >
> >
> > Did anyone encounter a similar problem before? Any suggestion is
> welcome.
> > Thank you!
> >
> >
> >
> > Regards,
> >
> >
> >
> > Debbie
> >
> >
> >
> >
> 
> 
> --
> Alexandre Patry, Ph.D
> Chercheur / Researcher
> http://KeaText.com



Re: RandomAccessFile problem in UIMA

Posted by Alexandre Patry <al...@keatext.com>.
Hi Debbie,

I recommend you to use extJWNL (https://github.com/extjwnl/extjwnl) 
instead of JWNL. We made the switch from JWNL and never looked back.

For your path problems, extJWNL distribute WordNet dictionaries as maven 
dependencies. It should become a non-issue.

Hope this help,

Alexandre

On 02/05/2014 03:36, Debbie Zhang wrote:
> Hi,
>
>   
>
> I am having problems to use JWNL wordnet in UIMA.
>
>   
>
> JWNL uses RandomAccessFile to read wordnet dictionary files. In order to
> create a PEAR file, wordnet dictionary files are put in resources/wordnet
> folder under project. As resources is in my Build Path, I have no problem to
> run the application I created in Eclipse. Therefore, I am  certain the
> dictionary files can be read. However, when I use UIMA Document Analyzer or
> UIMA CAS Visual Debugger to run the annotation, I get the following error:
>
>   
>
> java.io.FileNotFoundException: resources/wordnet/data.noun (No such file or
> directory)
>
>   
>
> The error comes from the following code:
>
>   
>
> RandomAccess _file = new RandomAccessFile(path, _permissions);
>
>   
>
> I use the following code to check the current working directory of the
> class:
>
>   
>
> URL location =
> PrincetonRandomAccessDictionaryFile.class.getProtectionDomain().getCodeSourc
> e().getLocation();
>
> System.out.println(location.getFile());
>
>   
>
> It seems both situation have the same location: /project/bin/
>
>   
>
> Did anyone encounter a similar problem before? Any suggestion is welcome.
> Thank you!
>
>   
>
> Regards,
>
>   
>
> Debbie
>
>   
>
>


-- 
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com