Skip to content

Commit

Permalink
Docstring according to pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
francescalb committed Sep 7, 2021
1 parent 4051131 commit 01d4b18
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions emmo/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,23 +1004,25 @@ def addancestors(e, n, s):
return ancestors

def get_wu_palmer_measure(self, cls1, cls2):
'''
Returns the Wu Palmer measure for semantic similarity between
""" Return Wu-Palmer measure for semantic similarity.
Returns Wu-Palmer measure for semantic similarity between
two concepts.
Wu, Palmer; ACL 94: Proceedings of the 32nd annual meeting on
Association for Computational Linguistics, June 1994.
'''
"""
cca = self.closest_common_ancestor(cls1, cls2)
ccadepth = self.number_of_generations(cca, self.Thing)
n1 = self.number_of_generations(cls1, cca)
n2 = self.number_of_generations(cls2, cca)
return 2 * ccadepth / (n1 + n2 + 2 * ccadepth)

def new_entity(self, name, parent):
'''
"""Create and return new entity
Makes a new entity in the ontology with given parent.
Return the new entity
'''
"""
with self:
e = types.new_class(name, (parent, ))
return e

0 comments on commit 01d4b18

Please sign in to comment.