WhichLicense detection
This is a library to facilitate the detection of licenses in source code.
Usage
License Detection
Gaoya detection
let mut gaoya = GaoyaDetection ;
gaoya.load_from_file;
// OR:
// for l in load_licenses_from_folder("./licenses/RAW"){
// gaoya.add_plain(l.name, l.text);
// }
Fuzzyhash-rs Detection
let mut fuzzy = FuzzyDetection ;
fuzzy.load_from_file;
// OR:
// for l in load_licenses_from_folder("./licenses/RAW"){
// fuzzy.add_plain(l.name, l.text);
// }
Pipeline System
The pipeline system was developed to automatically improve the results of license detection outputs by allowing further processing when a confidence is, for example, too low.
Diffing pipeline
The diffing pipeline works by only taking the modified license parts and putting them in a new string. This string is then passed to the regex provided to check if the changes matches the regex.

let regex_pipeline = DiffingPipeLine ;
let result = regex_pipeline.run;
assert_eq!
Regex pipeline
The regex pipeline works by taking the entire (incoming) license text and checking if it matches the regex provided.
let regex_pipeline = RegexPipeLine ;
let result = regex_pipeline.run;
assert_eq!
Attributions
ScanCode License data
The initial database was generated by making use of the license data from the ScanCode toolkit. You do not need to make use of this copyright notice in your project if you choose not to use the ScanCode license database. However, if you do make use of the ScanCode license database, you must include this copyright notice in your project.
Copyright (c) nexB Inc. and others. All rights reserved. ScanCode is a trademark of nexB Inc. SPDX-License-Identifier: CC-BY-4.0 See https://creativecommons.org/licenses/by/4.0/legalcode for the license text. See https://github.com/nexB/scancode-toolkit for support or download. See https://aboutcode.org for more information about nexB OSS projects.