jwnl initialise

Help
2008-12-08
2013-04-29
  • Ashwin Ittoo

    Ashwin Ittoo - 2008-12-08

    Hi
    I've been trying to figure out why i'm having a null pointer exception thrown by jwnl initialize method.
    java.lang.NullPointerException
        at net.didion.jwnl.JWNL.getParams(Unknown Source)
        at net.didion.jwnl.JWNL.getParams(Unknown Source)
        at net.didion.jwnl.JWNL.getParams(Unknown Source)
        at net.didion.jwnl.JWNL.createElementFromNode(Unknown Source)
        at net.didion.jwnl.JWNL.initialize(Unknown Source)

    I'm usning wordnet 2.0 and jwnl14-rc2
    I've also set the correct value for the dictionarypath element to point to my local copy. 
    Can anyone please help with this?

    ashwin

     
  • Prakashkumar

    Prakashkumar - 2013-01-25

    hi  ..this  prakash….
    i need ur help… any one can u help  

    JWNL.initialize(new FileInputStream(prop));
    this does't read prop file. when i execute this program in eclipse..i got  below this
    hello13
    hi  

    public class usage {

    public static void main(String args) throws IOException, FileNotFoundException ,JWNLException{
    IndexWord wordnet;
    try
    {
         System.out.println("hello13");
    String prop="C:\\jwnl\\jwnl14-rc2\\jwnl14-rc2\\config\\file_properties.xml";
                            JWNL.initialize(new FileInputStream(prop));
       wordnet = Dictionary.getInstance().getIndexWord(POS.VERB, "run");
              Synset sense = wordnet.getSense(1);
                    System.out.println(sense);
            PointerTargetNodeList relatedList = PointerUtils.getInstance().getSynonyms(sense);
            Iterator i = relatedList.iterator();
               while (i.hasNext()) {
                 PointerTargetNode related = (PointerTargetNode) i.next();
                 Synset s = related.getSynset();
                 System.out.println(s);
                         }
    }

    catch (Exception ex) {

    }
    }

    }

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks