From 01d4b18055fe8265f1a24f9afe4c5d15d8888335 Mon Sep 17 00:00:00 2001 From: francescalb Date: Tue, 7 Sep 2021 08:43:55 +0200 Subject: [PATCH] Docstring according to pep8 --- emmo/ontology.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/emmo/ontology.py b/emmo/ontology.py index 48c4a58b2..44a5a761f 100644 --- a/emmo/ontology.py +++ b/emmo/ontology.py @@ -1004,12 +1004,13 @@ 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) @@ -1017,10 +1018,11 @@ def get_wu_palmer_measure(self, cls1, cls2): 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