Pointer errors..........

Help
2004-08-18
2004-08-19
  • superduperlopez

    superduperlopez - 2004-08-18

    hello everyone,

    just wondering if anyone could help.........it would be extremely welcome!

    this is the code I am using:

            IndexWord car = Dictionary.getInstance().getIndexWord(POS.NOUN, "car");
            IndexWord bicycle = Dictionary.getInstance().getIndexWord(POS.NOUN, "bicycle");
           
             RelationshipList list = RelationshipFinder.getInstance().findRelationships
            (car.getSense(1), bicycle.getSense(1), PointerType.HYPERNYM);
            System.out.println("Hypernym relationship between \"" + car.getLemma()
            + "\" and \"" + bicycle.getLemma() + "\":");
       
            for (Iterator itr = list.iterator(); itr.hasNext();)
            {
                ((Relationship) itr.next()).getNodeList().print();
            }//end for
           
            System.out.println("Common Parent Index: " + ((AsymmetricRelationship)
            list.get(0)).getCommonParentIndex());
           
            System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());

        }//end method asymmetricRelationship

    AND THESE ARE ALL THE ERROS I AM GETTING...

    java.lang.NullPointerException
        at net.didion.jwnl.data.PointerTarget.getPointers(PointerTarget.java:39)
        at net.didion.jwnl.data.PointerTarget.getTargets(PointerTarget.java:53)
        at net.didion.jwnl.data.SynsetProxy.getTargets(SynsetProxy.java:47)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:523)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:477)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:444)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:430)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findAsymmetricRelationships(RelationshipFinder.java:92)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findAsymmetricRelationships(RelationshipFinder.java:77)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findRelationships(RelationshipFinder.java:54)
        at net.didion.jwnl.utilities.MyClass.asymmetricRelationship(MyClass.java:340)
        at net.didion.jwnl.utilities.MyClass.document2(MyClass.java:264)
        at net.didion.jwnl.utilities.MyClass.document1(MyClass.java:159)
        at net.didion.jwnl.utilities.MyClass.main(MyClass.java:58)
    Exception in thread "main"

     
    • minoan_boy

      minoan_boy - 2004-08-19

      May be this is a version problem (WordNet 1.7.1 <-> WordNet 2.0).

      Anthony...not sure of what I have said.

       

Log in to post a comment.