internal

package
v0.0.0-...-2773a1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownLicenseID = errors.New("license id is not known")

ErrUnknownLicenseID is raised if license identifier is not known. Probably you need to upgrade version of the SPDX.

Functions

func ExtractLicenseFiles

func ExtractLicenseFiles(files []string, fs filer.Filer) map[string][]byte

ExtractLicenseFiles returns the list of possible license texts. The file names are matched against the template. Reader is used to to read file contents.

func ExtractReadmeFiles

func ExtractReadmeFiles(files []string, fs filer.Filer) map[string][]byte

ExtractReadmeFiles searches for README files. Reader is used to to read file contents.

func InvestigateLicenseText

func InvestigateLicenseText(text []byte) map[string]float32

InvestigateLicenseText takes the license text and returns the most probable reference licenses matched. Each match has the confidence assigned, from 0 to 1, 1 means 100% confident.

func InvestigateLicenseTexts

func InvestigateLicenseTexts(candidates map[string][]byte) map[string]api.Match

InvestigateLicenseTexts takes the list of candidate license texts and returns the most probable reference licenses matched. Each match has the confidence assigned, from 0 to 1, 1 means 100% confident. Furthermore, each match contains a mapping of filename to the confidence that file produced.

func InvestigateReadmeText

func InvestigateReadmeText(text []byte, fs filer.Filer) map[string]float32

InvestigateReadmeText scans the README file for licensing information and outputs probable names found with Named Entity Recognition from NLP.

func InvestigateReadmeTexts

func InvestigateReadmeTexts(candidtes map[string][]byte, fs filer.Filer) map[string]api.Match

InvestigateReadmeTexts scans README files for licensing information and outputs the probable names using NER.

func IsLicenseDirectory

func IsLicenseDirectory(fileName string) bool

IsLicenseDirectory indicates whether the directory is likely to contain licenses.

func LookupName

func LookupName(id string) (string, error)

LookupName returns the SPDX name for the given license identifier

func LookupURLs

func LookupURLs(id string) ([]string, error)

LookupURLs returns the list of URLs for the given license identifier

func Preload

func Preload()

Preload license database

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL