Documentation ¶
Index ¶
- func CommentIndicatorNormalizer(text string) string
- func FlattenSpaceNormalizer(text string) string
- func GetLicenseContent(spdxID string) (string, error)
- func Identify(content string, threshold int) (string, error)
- func Normalize(license string) string
- func NormalizeHeader(header string) string
- func NormalizePattern(pattern string) string
- func OneLineNormalizer(text string) string
- func SubstantiveTextsNormalizer(text string) string
- type Normalizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentIndicatorNormalizer ¶
CommentIndicatorNormalizer trims the leading characters of comments, such as /*, <!--, --, (*, etc..
func FlattenSpaceNormalizer ¶
FlattenSpaceNormalizer flattens continuous spaces into a single space.
func GetLicenseContent ¶ added in v0.3.0
GetLicenseContent returns the content of the license file with the given Spdx ID.
func Identify ¶
Identify identifies the Spdx ID of the given license content. If it's a dual-license, it will return `<Licenses 1> and <Licenses 2>`.
func Normalize ¶
Normalize applies a chain of Normalizers to the license text to make it cleaner for identification.
func NormalizeHeader ¶
NormalizeHeader applies a chain of Normalizers to the file header to make it cleaner for identification.
func NormalizePattern ¶
NormalizePattern applies a chain of Normalizers to the license pattern to make it cleaner for identification.
func OneLineNormalizer ¶
OneLineNormalizer normalizes the text line by line and finally merge them into one line.
func SubstantiveTextsNormalizer ¶
SubstantiveTextsNormalizer normalizes the license text by substituting some words that doesn't change the meaning of the license.