concept depth

Help
tpoulain
2007-05-25
2013-04-29
  • tpoulain
    tpoulain
    2007-05-25

    i can't seem to find a simple way to get the depth of a given concept. assymetric relations tend to crash when i try to use them with an 'entity' concept, which was the solution i thought about when being unable to get a simple depth to root.

    -----
    btw, the crash says:
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at net.didion.jwnl.util.TypeCheckingList.get(TypeCheckingList.java:212)

    in the following function:
                    IndexWord start = Dictionary.getInstance().getIndexWord(POS.NOUN, "entity");
            IndexWord end = Dictionary.getInstance().lookupIndexWord(POS.NOUN, "physical_entity");
            RelationshipList list = RelationshipFinder.getInstance().findRelationships(start.getSense(1), end.getSense(1), PointerType.HYPERNYM);
            int dist_to_ancestor = ((AsymmetricRelationship) list.get(0)).getCommonParentIndex();

    any clue?