license

package
v0.0.0-...-038d724 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentIndicatorNormalizer

func CommentIndicatorNormalizer(text string) string

CommentIndicatorNormalizer trims the leading characters of comments, such as /*, <!--, --, (*, etc..

func FlattenSpaceNormalizer

func FlattenSpaceNormalizer(text string) string

FlattenSpaceNormalizer flattens continuous spaces into a single space.

func Identify

func Identify(content string) (string, error)

Identify identifies the Spdx ID of the given license content

func Normalize

func Normalize(license string) string

Normalize applies a chain of Normalizers to the license text to make it cleaner for identification.

func NormalizeHeader

func NormalizeHeader(header string) string

NormalizeHeader applies a chain of Normalizers to the file header to make it cleaner for identification.

func NormalizePattern

func NormalizePattern(pattern string) string

NormalizePattern applies a chain of Normalizers to the license pattern to make it cleaner for identification.

func OneLineNormalizer

func OneLineNormalizer(text string) string

OneLineNormalizer simply removes all line breaks to flatten the license text into one line.

func SubstantiveTextsNormalizer

func SubstantiveTextsNormalizer(text string) string

SubstantiveTextsNormalizer normalizes the license text by substituting some words that doesn't change the meaning of the license.

func VariablesNormalizer

func VariablesNormalizer(text string) string

VariablesNormalizer replace the variables actual value into variable name.

Types

type Normalizer

type Normalizer func(string) string

Jump to

Keyboard shortcuts

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