Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 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: NO

    try giving a positive argument to getSense() instead of
    zero.

     
  • John Didion
    John Didion
    2003-01-21

    • status: open --> closed