Skip to main content

Module license_detection

Module license_detection 

Source
Expand description

License Detection Engine

Re-exports§

pub use models::LicenseMatch;
pub use aho_match::aho_match;
pub use hash_match::hash_match;
pub use seq_match::MAX_NEAR_DUPE_CANDIDATES;
pub use seq_match::compute_candidates_with_msets;
pub use seq_match::seq_match_with_candidates;
pub use spdx_lid::spdx_lid_match;
pub use unknown_match::unknown_match;

Modules§

aho_match
Aho-Corasick exact matching for license detection.
embedded
Embedded license index loading.
expression
License expression parsing and manipulation.
hash_match
Hash-based exact matching for license detection.
index
License index construction and querying.
models
Core data structures for license detection.
query
Query processing - tokenized input for license matching.
rules
Rule loading and orchestration.
seq_match
Approximate sequence matching for license detection.
spans
Span - efficient integer range sets.
spdx_lid
SPDX-License-Identifier detection and parsing.
spdx_mapping
SPDX license key mapping for license expressions.
tokenize
Text tokenization and normalization.
unknown_match
Unknown license detection using ngram matching.

Structs§

LicenseDetection
A LicenseDetection combines one or more LicenseMatch objects using various rules and heuristics.
LicenseDetectionEngine
License detection engine that orchestrates the detection pipeline.

Constants§

SCANCODE_LICENSES_DATA_PATH
Path to the license data directory in the reference scancode-toolkit submodule. Used by test code and the xtask generate-license-loader-artifact binary.
SCANCODE_LICENSES_LICENSES_PATH
Path to the licenses directory in the reference scancode-toolkit submodule. Used by test code and the xtask generate-license-loader-artifact binary.
SCANCODE_LICENSES_RULES_PATH
Path to the license rules directory in the reference scancode-toolkit submodule. Used by test code and the xtask generate-license-loader-artifact binary.

Functions§

create_detection_from_group
Create a basic LicenseDetection from a DetectionGroup.
filter_invalid_contained_unknown_matches
Filter unknown matches contained within good matches’ qregion.
group_matches_by_region
merge_overlapping_matches
Merge overlapping and adjacent matches for the same rule.
post_process_detections
Main post-processing function for detections.
refine_matches
Main refinement function - applies all refinement operations to match results.
refine_matches_without_false_positive_filter
Initial refinement without false positive filtering.
sort_matches_by_line
Sort matches by start token position with tie-breaking criteria.
split_weak_matches
Split matches into good and weak matches.