Lenght/norm/magnitude of vector representation of document.
        This is usually denoted by ||d||.

def magnitude(self):
        """
        Lenght/norm/magnitude of vector representation of document.
        This is usually denoted by ||d||.
        """
        return math.sqrt(sum(t**2 for t in self._terms.values()))