normalize

package
v0.0.0-...-7bf9130 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LicenseText

func LicenseText(text string, strictness Strictness) string

LicenseText makes a license text ready for analysis. It follows SPDX guidelines at https://spdx.org/spdx-license-list/matching-guidelines

func Relax

func Relax(text string) string

Relax applies very aggressive normalization rules to text.

func Split

func Split(text string) []string

Split applies heuristics to split the text into several parts

Types

type Strictness

type Strictness int

Strictness represents the aggressiveness of the performed normalization. The bigger the number, the more aggressive. See `Enforced`, `Moderate` and `Relaxed`.

const (
	// Enforced is the strictest mode - only the official SPDX guidelines are applied.
	Enforced Strictness = 0
	// Moderate is equivalent to Enforced with some additional normalization: dots are removed, copyright lines too.
	Moderate Strictness = 1
	// Relaxed is the most powerful normalization, Moderate + Unicode normalization and all non-alphanumeric chars removed.
	Relaxed Strictness = 2
)

Jump to

Keyboard shortcuts

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