Documentation ¶
Index ¶
- Variables
- func ExtractLicenseFiles(files []string, fs filer.Filer) map[string][]byte
- func ExtractReadmeFiles(files []string, fs filer.Filer) map[string][]byte
- func InvestigateLicenseText(text []byte) map[string]float32
- func InvestigateLicenseTexts(candidates map[string][]byte) map[string]api.Match
- func InvestigateReadmeText(text []byte, fs filer.Filer) map[string]float32
- func InvestigateReadmeTexts(candidtes map[string][]byte, fs filer.Filer) map[string]api.Match
- func IsLicenseDirectory(fileName string) bool
- func LookupName(id string) (string, error)
- func LookupURLs(id string) ([]string, error)
- func Preload()
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
ExtractReadmeFiles searches for README files. Reader is used to to read file contents.
func InvestigateLicenseText ¶
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 ¶
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 ¶
InvestigateReadmeText scans the README file for licensing information and outputs probable names found with Named Entity Recognition from NLP.
func InvestigateReadmeTexts ¶
InvestigateReadmeTexts scans README files for licensing information and outputs the probable names using NER.
func IsLicenseDirectory ¶
IsLicenseDirectory indicates whether the directory is likely to contain licenses.
func LookupName ¶ added in v4.3.1
LookupName returns the SPDX name for the given license identifier
func LookupURLs ¶ added in v4.3.1
LookupURLs returns the list of URLs for the given license identifier
Types ¶
This section is empty.