mrmechko / pytrips

GNU General Public License v2.0
6 stars 2 forks source link

`ont['event-of-causation'].word_closure()` is empty with any depth #19

Closed sidsvash26 closed 5 years ago

sidsvash26 commented 5 years ago

ont['event-of-causation'].word_closure() returns an empty set with any chosen depth. To replicate the issue, you can run this:

from pytrips.ontology import load
ont = load()
for i in range(10):
    ont.max_wn_depth = i
    print("Number of words in closure with depth {} -  {}".format(i, len(ont['event-of-causation'].word_closure())))

Output:

Number of words in closure with depth 0 -  0
Number of words in closure with depth 1 -  0
Number of words in closure with depth 2 -  0
Number of words in closure with depth 3 -  0
Number of words in closure with depth 4 -  0
Number of words in closure with depth 5 -  0
Number of words in closure with depth 6 -  0
Number of words in closure with depth 7 -  0
Number of words in closure with depth 8 -  0
Number of words in closure with depth 9 -  0

Is this something expected or a bug?

sidsvash26 commented 5 years ago

Just looked at the ontology.py code and realized this will be true for all ontology types whose wordnet_sense_keys is empty in the ontology.json file.

mrmechko commented 5 years ago

Many ontology types don't actually contain any word/wordnet entries.