extractor

package
v0.0.0-...-e00fc7b Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor struct

func New

func New(threshold float64) (*Extractor, error)

New Extractor

func (*Extractor) Extracts

func (e *Extractor) Extracts(filenames []string, headers bool) (errors []error)

Extracts licenses

func (*Extractor) ExtractsWithContext

func (e *Extractor) ExtractsWithContext(ctx context.Context, filenames []string, headers bool) (errors []error)

ExtractsWithContext runs the license classifier over the given file; ensure that it will respect the timeout in the provided context.

func (*Extractor) GetResults

func (e *Extractor) GetResults() LicenseTypes

GetResults returns the results of the classifications.

type LicenseType

type LicenseType struct {
	Filename   string
	Name       string
	Confidence float64
	Offset     int
	Extent     int
}

LicenseType is the assumed type of the unknown license.

type LicenseTypes

type LicenseTypes []*LicenseType

LicenseTypes is a list of LicenseType objects.

func (LicenseTypes) Len

func (lt LicenseTypes) Len() int

func (LicenseTypes) Less

func (lt LicenseTypes) Less(i, j int) bool

func (LicenseTypes) Swap

func (lt LicenseTypes) Swap(i, j int)

Jump to

Keyboard shortcuts

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