(self, summary_base = True)
Return the DENSITY score of summary and text.

        Arguments:

            - summary_base (bool): use summary as numerator (default = True)

        Returns:

            - decimal DENSITY score within [0, ...]
def density(self, summary_base = True):

        """

        Return the DENSITY score of summary and text.

        Arguments:

            - summary_base (bool): use summary as numerator (default = True)

        Returns:

            - decimal DENSITY score within [0, ...]

        """

        numerator = sum(o.length ** 2 for o in self.overlaps())

        if summary_base: denominator = len(self.summary)
        else:            denominator = len(self.reference)

        if denominator == 0: return 0
        else:                return numerator / denominator
def density ( self , summary_base = True ) : numerator = sum ( o . length ** 2 for o in self . overlaps ( ) ) if summary_base : denominator = len ( self . summary ) else : denominator = len ( self . reference ) if denominator == 0 : return 0 else : return numerator / denominator