MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / idensity

Method idensity

src/licensedcode/match.py:581–590  ·  view source on GitHub ↗

Return the ispan density of this match as a ratio of its rule-side matched length to its rule side magnitude. This is a float between 0 and 1. A dense match has all its matched rule tokens contiguous and a maximum idensity of one. A sparse low idensity match has some

(self)

Source from the content-addressed store, hash-verified

579 return mlen / qmagnitude
580
581 def idensity(self):
582 """
583 Return the ispan density of this match as a ratio of its rule-side
584 matched length to its rule side magnitude. This is a float between 0 and
585 1. A dense match has all its matched rule tokens contiguous and a
586 maximum idensity of one. A sparse low idensity match has some non-
587 contiguous matched rule tokens interspersed between matched rule tokens.
588 An empty match has a zero qdensity.
589 """
590 return self.ispan.density()
591
592 def score(self):
593 """

Callers 2

representationMethod · 0.95
filter_spurious_matchesFunction · 0.80

Calls 1

densityMethod · 0.80

Tested by

no test coverage detected