def __repr__(self): # TODO: Indicate which one is the "primary" return 'Cluster, "%s", of %d elements with relevance %f, dataQuality %f.\n%s' % \ (self.primary_result.resolverObject.name.encode('utf-8'), len(self.__results), self.relevance, self.dataQuality, '\n'.join(indentText(str(result), 4) for result in self.__results))
def __repr__(self): relevanceScoringDetails = '\n'.join([' %s: %f' % component for component in self.__relevanceDebugInfo]) reprComponents = ['Relevance score: %f' % self.relevance, 'Relevance score details:\n%s' % relevanceScoringDetails, 'Data quality score: %f' % self.dataQuality ] if self.__dataQualityDebugInfo: dataQualityScoringDetails = '\n'.join([' %s: %f' % component for component in self.__dataQualityDebugInfo]) reprComponents.append('Data quality score details:\n%s' % dataQualityScoringDetails) reprComponents.append('Result:\n%s' % indentText(str(self.resolverObject), 4)) return '\n'.join(reprComponents)