From 0b97ee326a80bfc22f8904bbc84e69ea5aedb59c Mon Sep 17 00:00:00 2001 From: Nafisa Tahasin Date: Tue, 31 Mar 2026 13:08:01 +0530 Subject: [PATCH] Add explanation for relevance attribute in license rule documentation --- .../scancode-license-detection-updates.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/explanation/scancode-license-detection-updates.rst b/docs/source/explanation/scancode-license-detection-updates.rst index 88715aec887..9b026f0a334 100644 --- a/docs/source/explanation/scancode-license-detection-updates.rst +++ b/docs/source/explanation/scancode-license-detection-updates.rst @@ -527,6 +527,20 @@ I.e. the identifier is a `RULE` or a `LICENSE` file. Example: ``apache-2.0_2.RULE`` Other attributes are it's license-expression, the boolean fields, length, relevance etc. +Relevance +--------- + +The `relevance` attribute represents the importance of a rule when detecting +licenses. It acts as a scoring mechanism that helps ScanCode prioritize stronger +matches over weaker ones. + +Rules with higher relevance values indicate stronger evidence that the matched +text corresponds to a specific license. For example, rules matching the main +license text usually have higher relevance, while rules matching smaller license +references or fragments may have lower values. + +This scoring helps ScanCode select the most accurate license detection when +multiple rules match the same piece of text. CLI option