#1 problem with test program

closed
nobody
5
2003-01-21
2002-01-10
No

Hello,
After installing the jwnl package, I wrote a very small program to check if all was ok, but there was
a strange exception. Can anybody tell me if I did something silly or if I forgot some installation
steps ?

What I did :
- unzip the package
- set the CLASSPATH
- edit file_properties.xml to set the path of WordNet on my pc
- write & compile the program :

import net.didion.*;
import net.didion.jwnl.*;
import net.didion.jwnl.data.*;
import net.didion.jwnl.dictionary.*;
import java.io.FileInputStream;

public class wn{

public static void main(String[] args) {

try {
JWNL.initialize(new FileInputStream("file_properties.xml"));
Dictionary dico = Dictionary.getInstance();
IndexWord iw = dico.lookupIndexWord(POS.NOUN, "peel");
Synset ss = iw.getSense(0);
System.out.println(ss.getGloss());
}
catch(net.didion.jwnl.JWNLException e){System.out.println(e);}
catch (java.io.FileNotFoundException e){System.out.println(e);}
}
}

At runtime :
Exception in thread "main" java.lang.NumberFormatException: NUMBER_OF_VERB_FRAMES
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at net.didion.jwnl.data.VerbFrame.initialize(VerbFrame.java:22)
at net.didion.jwnl.JWNL.initialize(JWNL.java:136)
at wn.main(wn.java:12)

(line 12 is : JWNL.initialize(new FileInputStream("file_properties.xml"));)

Thanks for any help

Discussion

  • Logged In: YES
    user_id=134899

    Hi,

    I think I solved the problem. Copy the properties files in
    the root directory of your project.

    Dinel

     
  • Nick Rowlands
    Nick Rowlands
    2003-01-11

    Logged In: YES
    user_id=685456

    That should work fine except change:

    Synset ss =
    iw.getSense(0);

    to

    Synset ss =
    iw.getSense(1);

    Cheers,
    Nick.

     
  • Nick Rowlands
    Nick Rowlands
    2003-01-11

    Logged In: YES
    user_id=685456

    This code works fine for me except I have to change the
    line:

    Synset ss = iw.getSense(0);

    to

    Synset ss =
    iw.getSense(1);

    otherwise I get an
    ArrayIndexOutOfBoundsException().

    Cheers,
    Nick.

     
  • John Didion
    John Didion
    2003-01-21

    • status: open --> closed