Skip to content

Commit

Permalink
Add human-readable string representation for TermSimilarityIndex (cont.)
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Jul 22, 2020
1 parent 6ef9ef9 commit ab41346
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gensim/similarities/termsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ def most_similar(self, term, topn=10):
raise NotImplementedError

def __str__(self):
return "%s(%s)" % (
self.__class__.__name__,
', '.join(
'%s=%s' % (key, value)
for key, value
in vars(self).items()
)
)
members = ', '.join('%s=%s' % pair for pair in vars(self).items())
return '%s(%s)' % (self.__class__.__name__, members)


class UniformTermSimilarityIndex(TermSimilarityIndex):
Expand Down

0 comments on commit ab41346

Please sign in to comment.