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

Function has_extra_words

src/licensedcode/detection.py:1133–1148  ·  view source on GitHub ↗

Return True if any of the matches in ``license_matches`` List of LicenseMatch has extra words. Having extra words means contains a perfect match with a license/rule, but there are some extra words in addition to the matched text.

(license_matches)

Source from the content-addressed store, hash-verified

1131
1132
1133def has_extra_words(license_matches):
1134 """
1135 Return True if any of the matches in ``license_matches`` List of LicenseMatch
1136 has extra words.
1137
1138 Having extra words means contains a perfect match with a license/rule, but there
1139 are some extra words in addition to the matched text.
1140 """
1141 match_query_coverage_diff_values = (
1142 calculate_query_coverage_coefficient(license_match)
1143 for license_match in license_matches
1144 )
1145 return any(
1146 match_query_coverage_diff_value > 0
1147 for match_query_coverage_diff_value in match_query_coverage_diff_values
1148 )
1149
1150
1151def has_low_rule_relevance(license_matches):

Tested by

no test coverage detected