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 spdx_lid::spdx_lid_match;
pub use unknown_match::unknown_match;

Modules§

aho_match
Aho-Corasick exact matching for license detection.
automaton
Aho-Corasick automaton wrapper using daachorse.
embedded
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.
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§

LicenseDetectionEngine
License detection engine that orchestrates the detection pipeline.
PositionSet
A set of usize positions stored as a BitSet. Provides O(1) membership testing and efficient set operations. Caches bounds for cheap overlap pre-checks.
TokenMultiset
A multiset of token IDs stored as token -> occurrence count.
TokenSet
A set of token IDs stored as a sorted SmallVec.

Constants§

DEFAULT_LICENSEDB_URL_TEMPLATE
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§

filter_invalid_contained_unknown_matches
Filter unknown matches contained within good matches’ qregion.
merge_overlapping_matches
Merge overlapping and adjacent matches for the same rule.
refine_matches
Main refinement function - applies all refinement operations to match results.
refine_matches_without_false_positive_filter
Initial refinement without false positive filtering.
split_weak_matches
Split matches into good and weak matches.